If I do a Plot with Frame->True is there a way I can find the coordinates of the corners of the Frame in the absolute coordinates of the image? I have the numerical values of PlotRange and PlotRangePadding but note that I don’t want to tamper with the actual plot in any way, just find out where in the full display area Mathematica chooses to place the frame/axes of the plot.
As pointed out by Brett Champion, I’m looking for the coordinates {x,y} such that Scaled[{0,0}] == ImageScaled[{x,y}].
[Note that I edited this question to remove my confusing misuse of the term “scaled coordinates”.]
The corners of the frame are at
Scaled[{0,0}]andScaled[{1,1}].The corners of the full graphic (including labels) are at
ImageScaled[{0,0}]andImageScaled[{1,1}].Converting between them is hard, although in theory it’s possible to convert
Scaledand user (unscaled) coordinates if you know the actual, numeric, settings forPlotRangeandPlotRangePadding.Depending on your application, you might also be able to use MousePosition, which knows these things as well.
Rasterize(and HTML export) also know how to find bounding boxes of annotations, in a bitmap/pixel coordinate system:Here’s how dreeves used that Rasterize trick to make a function to return exactly what he was looking for (note the assumption of a global variable
imgszwhich gives the ImageSize option for rasterizing the plot — the coordinates of the frame depend on that value):