How can I access the attributes of a plot after creating it?
For example, I was hoping to get the y-axis limits from a plot. Something like this didn't work:
p1 = Plots.plot(rand(10))
get(p1,:ylim)
This errors:
MethodError: no method matching get(::Plots.Plot{Plots.GRBackend}, ::Symbol)
                Plots are organized into subplots (often just one) which are organized into series. In this case you want the y axis limits, which is a function of the subplot. Normally you can get a named attribute (e.g. y) from the first series in the first subplot by 
p1[1][1][:y]
In the case of limits it's a little more complicated, they are properties of Axis which are owned by the subplot. But luckily you can just do
ylims(p1)
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With