Say I have some plot
plot = Plot[Sin[x], {x,0,10}] (*as an example*)
Is there a way I can get the x and y axes min/max values from the "plot" variable?
If I wanted the image sizes I could do
ImageDimensions[plot]
I'm looking for something like this but for the axes (either total length or min/max values). I want to draw some additional graphics on the plot but it needs to be appropriately scaled.
Thanks!
Answer
Also
PlotRange[plot]
PlotRange /. AbsoluteOptions[plot]
Last @@ AbsoluteOptions[plot, PlotRange]
PlotRange /. plot[[2]]
all give
(* {{0.,10.},{-0.999999,1.}} *)
Note: Regarding usage of PlotRange as a function, it is undocumented, and the earliest reference I could find on this site is this answer dated Oct 11, 2012:
Since then, also used in
Comments
Post a Comment