I have a value and plot a histogram like this (log-log scale): The code for the histogram is as follows:
histogram(log.(degree), bins=50, yaxis = (:log10))
title!("Degree distribution (log-log scale)")
I want to add a line to the histogram to show it is a power law distribution. It will look like this:
In
Plots.jl
you can just plot onto the previous plots (or more generally modify them) by adding a!
to the command, so if you want do plot a line (or any other data) on top of a histogram you can do something like:The other part is how to get the fit of the power law distribution, but I assumed that your problem is more about how to plot those things. Distributions.jl might help with the distribution fitting.