Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4254730
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T05:07:24+00:00 2026-05-21T05:07:24+00:00

If I do a Plot with Frame->True is there a way I can find

  • 0

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”.]

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T05:07:25+00:00Added an answer on May 21, 2026 at 5:07 am

    The corners of the frame are at Scaled[{0,0}] and Scaled[{1,1}].

    The corners of the full graphic (including labels) are at ImageScaled[{0,0}] and ImageScaled[{1,1}].

    Converting between them is hard, although in theory it’s possible to convert Scaled and user (unscaled) coordinates if you know the actual, numeric, settings for PlotRange and PlotRangePadding.

    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:

    In[33]:= Rasterize[
     Plot[Sin[x], {x, 0, 10}, Frame -> True, 
      Prolog -> {LightYellow, 
        Annotation[Rectangle[Scaled[{0, 0}], Scaled[{1, 1}]], "One", 
         "Region"]}], "Regions"]
    
    Out[33]= {{"One", "Region"} -> {{22., 1.33573}, {358.9, 209.551}}}
    

    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 imgsz which gives the ImageSize option for rasterizing the plot — the coordinates of the frame depend on that value):

    (* Returns the geometry of the frame of the plot: 
       {width, height, x offset, y offset, total width, total height}. *)
    geom[p_Graphics] := Module[{q, x1, y1, x2, y2, xmax, ymax},
      q = Show[p, Prolog->{Annotation[Rectangle[Scaled[{0,0}], Scaled[{1,1}]], 
                                      "MAGIC00","MAGIC11"]}];
      {{x1,y1}, {x2,y2}} = Rasterize[q, "Regions", ImageSize->imgsz][[1,2]];
      {xmax,ymax} = Rasterize[p, "RasterSize", ImageSize->imgsz];
      {x2-x1, y2-y1, x1, y1, xmax, ymax}]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a data frame detailing edge weights among N nodes. Is there a
I have a basic plot of a two column data frame (x = Periods
I have point series in a data.frame with duplication. I would like to plot
All right, let's say I have the following plot. df = data.frame(date=c(rep(2008:2013, by=1)), value=c(303,407,538,696,881,1094))
I have a data frame with 251 observations and 45 variables. There are 6
I have the following plot: library(ggplot2) ib<- data.frame( category = factor(c(Cat1,Cat2,Cat1, Cat1, Cat2,Cat1,Cat1, Cat2,Cat2)),
I have a data.frame called series_to_plot.df which I created by combining a number of
I'm trying to plot values as a function of the date (only hh:mm:ss, without
I am trying to plot a graph using gnuplot. I have six text files.
I can't find any documentation of the following problem I'm having with the axis

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.