MathGroup Archive 2010

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

Search the Archive

Re: How to extract ImageSize?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg112839] Re: How to extract ImageSize?
  • From: "David Park" <djmpark at comcast.net>
  • Date: Sun, 3 Oct 2010 03:37:15 -0400 (EDT)
  • References: <14523943.21633.1286013656382.JavaMail.root@m06>

p = Plot[Sin[x], {x, -2, 2}];

ImageSize is not an explicit option in p.

Part[p, 2]

{AspectRatio -> 1/GoldenRatio, Axes -> True, AxesOrigin -> {0, 0},
 PlotRange -> {{-2, 2}, {-1., 1.}}, PlotRangeClipping -> True,
 PlotRangePadding -> {Scaled[0.02], Scaled[0.02]}}

So it takes on its default value, which is Automatic and you can't extract
it from p.

But if you wrap the actual plot output as:

ImageSize /. AbsoluteOptions[plot output]

and adjust the output size by dragging a handle, and then evaluate, you will
obtain a value for the option.

{342.692, Automatic}

(Are you sure you don't mean PlotRange?)


David Park
djmpark at comcast.net
http://home.comcast.net/~djmpark/ 


From: Istv=E1n Zachar [mailto:zac at freemail.hu]

Dear Group,

is there any way to extract the exact numerical values of ImageSize
from a plot, if no explicit value was supplied by the user?

In[53]:= ImageSize /. Options@Plot

Out[53]= Automatic

In[54]:= p = Plot[Sin[x], {x, -2, 2}];
ImageSize /. AbsoluteOptions@p

Out[55]= Automatic

In[56]:= p = Plot[Sin[x], {x, -2, 2}, ImageSize -> Small];
ImageSize /. AbsoluteOptions@p

Out[57]= Small



Istvan



  • Prev by Date: Astronomical Data Accuracy
  • Next by Date: Re: How to unflatten an array ?
  • Previous by thread: How to extract ImageSize?
  • Next by thread: Re: How to extract ImageSize?