-1

I want to visualize a histogram graphics in R. The problem is that the distribution of data is highly exponential as in the figure below enter image description here

AlketCecaj
  • 117
  • 1
  • 11

1 Answers1

2

Save the histogram as a variable and then apply log10 to the bin counts. Set the -Inf values to 0 and then plot the new counts.

# make histogram of the data
h <- hist(data)

# log10 the counts per histogram bin
h$counts <- log10(h$counts)

# set the -Inf values to 0
h$counts[!is.finite(h$counts)] <- 0

# plot the log10 counts
plot(h)
Justin Braaten
  • 711
  • 7
  • 13