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

**URL:** <https://discourse.julialang.org/t/why-the-y-axis-is-not-showing-as-log-scale-even-it-is-scaled/105398>\
**Category:** New to Julia\
**Tags:** plotting, network-analysis\
**Created:** [October 25, 2023, 8:56pm UTC](https://discourse.julialang.org/t/why-the-y-axis-is-not-showing-as-log-scale-even-it-is-scaled/105398 "2023-10-25T20:56:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chao](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chao/32/50725_2.png) [@Chao](https://discourse.julialang.org/u/Chao)\
**Post date:** [October 25, 2023, 8:56pm UTC](https://discourse.julialang.org/t/why-the-y-axis-is-not-showing-as-log-scale-even-it-is-scaled/105398/1 "2023-10-25T20:56:09Z")

</div>

Hello, I am doing a degree distribution.

This is the degree distribution without scaled.

 ![image](https://global.discourse-cdn.com/julialang/original/3X/3/a/3ae7479c9e5b8d961e593b859b51265180c37452.png)

The code for the above plot is this:

```julia
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:

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

```

And I got the log-log scale plot:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/8/5/857062f4191085fc178bc46bf3f917f708a58d9b.png)

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.

---

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [October 25, 2023, 9:04pm UTC](https://discourse.julialang.org/t/why-the-y-axis-is-not-showing-as-log-scale-even-it-is-scaled/105398/2 "2023-10-25T21:04:07Z")

</div>

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_)
