But I wonder if these histograms share a same height scale so that we can compare between different histograms according to the bar heights. To make it more clear, let’s take the following example where there is only one bar for each histogram,
fig = Figure()
ax = Axis(fig[1, 1])
for i in 1:5
if i != 5
hist!(ax, randn(1000), scale_to=-0.6, offset=i, direction=:x, bins=1)
else
hist!(ax, randn(10), scale_to=-0.6, offset=i, direction=:x, bins=1)
end
end
fig
Since here the height (or the horizontal width) of the bar reflects the sample size, we expect the last bar should be shorter than the others (99/100 shorter) but it isn’t. Is there anyone who knows how to achieve this goal?
You are manually setting the height with the scale_to argument:
scale_to
Allows to scale all values to a certain height.
Consequently, you can compare two histograms only by the relative weights.
I don’t think you can do that this way. If the histograms are supposed to display absolute frequencies (not relative), then I would say that this way of visualization (many histograms distributed along the horizontal axis) is not suitable.
Yes. But actually I don’t quite understand from the doc what exactly scale_to=-0.6 means. Does that mean it scales all the highest bars of different histograms to a same absolute height (0.6) , or it just scales the histograms to 0.6 of their own default settings?
I want to visualize 3 random variables following time-varying distributions on one figure. I hope to compare them from both time and space perspectives.
What is the error you are seeing? If it’s the same error I’m seeing it tells you exactly what’s going on and why this doesn’t work:
ERROR: ArgumentError: You cannot pass `axis` as a keyword argument
to this plotting function.
Note that `axis` can only be passed to non-mutating plotting functions
(not ending with a `!`) that implicitly create an axis, and `figure`
only to those that implicitly create a `Figure`.
violin | Makie
Does anyone know, if the scale of violin plots is consistent? (i.e., is it comparable between multiple violin plots of the same figure?)