Why the y-axis is not showing as log scale even it is scaled

Hello, I am doing a degree distribution.

This is the degree distribution without scaled.

The code for the above plot is this:

histogram(degree, bins=50)
title!("Degree distribution")

Because I want to check whether it is power law distribution, so I scaled the x- and y- axe. The code is this:

histogram(log10.(degree), bins=50,  yscale=:log10)
title!("Degree distribution (log-log scale)")

And I got the log-log scale plot:

The problem is that it seems the second plot shows a power law distribution. But I do not understand:
1, after the y axe log10 scaled, the range of the original is 0:60000, after log10 scaled, it should be 0:4.78, why the range of the y in the second plot is 1:10000?

Thank you.

The command log10.(degree) changes the numerical values of the x-axis, while the plot scale command yscale=:log10 doesn’t change anything numerically, it just changes the scale. Note that the y-axis is displayed in log scale and 10^4.78 ~ 60000 (the exponent varies linearly along the new log-scaled axis)

1 Like