MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Graphics: How to get values corresponding to

  • To: mathgroup at
  • Subject: [mg113730] Re: Graphics: How to get values corresponding to
  • From: Bob Hanlon <hanlonr at>
  • Date: Tue, 9 Nov 2010 03:54:03 -0500 (EST)

The issue is not whether the two plots are identical when displayed in the same Show but rather whether g and g2 individually have the same ImageSize, i.e., whether AbsoluteCurrentValue[g, ImageSize] accurately gives the ImageSize of g.

The initial image (g) has a default AspectRatio of 1/GoldenRatio so the ImageSize for g is not square. Whether AbsoluteCurrentValue[g, ImageSize] returns {350, 350} or {400,400} this does not represent the ImageSize of g. As a result, the bounding box for g2 has gaps at the top and bottom that are not present in the bounding box of g.

Bob Hanlon

---- Alexei Boulbitch <alexei.boulbitch at> wrote: 

Dear Bob,

I tried this your example:

g1 = Plot[Sin[y], {y, 0, 6 Pi}, PlotStyle ->  Red];

g2 = Plot[Sin[y], {y, 0, 6 Pi},
    ImageSize ->  AbsoluteCurrentValue[g, ImageSize]];

Show[{g1, g2}]

on my machine (PC, WinXP Pro, Math7). The two images happen to coincide (at least visually). The command
AbsoluteCurrentValue[g1, ImageSize]

{350, 350}

returned the size of 350, rather then 400 in my case.

Best regards, Alexei

While AbsoluteCurrentValue returns values, it is not the actual ImageSize of the original graphic.

g = Plot[Sin[y], {y, 0, 6 Pi}]

AbsoluteCurrentValue[g, ImageSize]

{400, 400}

g2 = Plot[Sin[y], {y, 0, 6 Pi},
   ImageSize ->  AbsoluteCurrentValue[g, ImageSize]]

Bob Hanlon

---- "Sjoerd C. de Vries"<sjoerd.c.devries at>  wrote:

AbsoluteCurrentValue[g, ImageSize] works for me, but I'm at loss as to
why AbsoluteOptions doesn't work.

Perhaps the documentation should be improved. Shall we start a thread
on that?  ;-)

Cheers -- Sjoerd

On Nov 2, 11:00 am, kj<no.em... at>  wrote:
>  Consider the following example.
>  In[1]:= g = Plot[Sin[y], {y, 0, 6 Pi}];
>  In[2]:= ImageSize /. FullOptions[g]
>  Out[2]:= Automatic
>  How can I determine the *number* X (!= Automatic) such that the
>  graphic generated by Plot[Sin[y], {y, 0, 6 Pi}, ImageSize->X] looks
>  identical to g as defined in In[1]?
>  More generally, for any option that accepts Automatic as a possible
>  value, how can I determine the whether there exists some value X
>  (distinct from Automatic) such that specifying X as the value of
>  this option would produce exactly the same results as specifying
>  Automatic, and if so, how can I determine this value?
>  Thanks!
>  ~kj

Alexei Boulbitch, Dr. habil.
Senior Scientist
Material Development

ZAE Weiergewan
11, rue Edmond Reuter

Tel: +352 2454 2566
Fax: +352 2454 3566
Mobile: +49 (0) 151 52 40 66 44

e-mail: alexei.boulbitch at


This e-mail may contain trade secrets or privileged, undisclosed or
otherwise confidential information. If you are not the intended
recipient and have received this e-mail in error, you are hereby
notified that any review, copying or distribution of it is strictly
prohibited. Please inform us immediately and destroy the original
transmittal from your system. Thank you for your co-operation.


Bob Hanlon

  • Prev by Date: Re: pure function
  • Next by Date: Re: How to "soft-code" a Block?
  • Previous by thread: Re: Graphics: How to get values corresponding to
  • Next by thread: Re: := vs = in some function definitions