Hi all! I noticed that, when plotting the probability distribution of some data with Plots.jl with density(x), the axis representing the “underlying” data, is on the x axis:
using Plots
using StatsPlots
x = [1,1,1,2,2]
density(x)
If we use Unitful.jl, that has recipes for plotting, we get:
using Plots
using StatsPlots
using Unitful
x = [1,1,1,2,2] .* u"m"
density(x)
You’ll see that the additional label of the unit (in this case “m”) is shown on the y-axis. Is there a reason, or is it a bug? Thanks!
Appendix: Note that for histogram(x) it is correctly displayed on the x axis:


