MathGroup Archive 2009

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

Search the Archive

Re: Re: ImageSize->Full does not work as expected

  • To: mathgroup at smc.vnet.net
  • Subject: [mg103557] Re: [mg103514] Re: ImageSize->Full does not work as expected
  • From: John Fultz <jfultz at wolfram.com>
  • Date: Sun, 27 Sep 2009 23:07:12 -0400 (EDT)
  • Reply-to: jfultz at wolfram.com

On Sat, 26 Sep 2009 06:12:20 -0400 (EDT), Alexey wrote:
> On 25 Sep, 15:53, Alexey <lehi... at gmail.com> wrote:
>
>> Hello,
>> I have a 1680x1050 monitor and use it with resolution 120dpi (instead
>> of 72dpi by default). I have found that ImageSize does not work
>> properly. For example, try the following:
>>
>> In[2]:= im = Graphics[Disk[{1, 1}], ImageSize -> Full]
>> im // ImageDimensions
>>
>> Out[2]= \!\(\*
>> GraphicsBox[DiskBox[{1, 1}],
>> ImageSize->Full]\)
>>
>> Out[3]= {1172, 1171}
>>
>> This code gives a graphics that do not "fills out the enclosing
>> region" as should be according to the Documentation. In really the
>> size of the graphics does not depend on the size of window where it is
>> displayed and even when I maximizing the window this graphics goes
>> outside of it.
>>
>> As I can see this is a bug.
>> If it is not, Is there a way to get graphics that fills out the
>> enclosing region in the window (and being resized when the window is
>> resized)?
>>
> I have found the source of this behavior. It is an option
> "Magnification" that is by default 1 but changed by me for better on-
> screen presentation. So, ImageSize->Full fully ignores Magnification
> even if Magnification is set only for the current evaluation notebook.

FYI, this bug was discovered internally several months ago and has subsequently 
been fixed in the development version of Mathematica.  So, you should see a fix 
in the next Mathematica release.

In the mean time, You can work around the problem by using the following setting 
for ImageSize:

ImageSize :> Scaled[1./CurrentValue[Magnification]]

Note, however, that this workaround is merely exploiting the exact same bug in 
Scaled (which was also fixed).  So, short of doing version checks in your code, 
there's no way to avoid having to tweak the code to preserve the behavior once 
the next version of Mathematica comes out.

Sincerely,
 
John Fultz
jfultz at wolfram.com
User Interface Group
Wolfram Research, Inc.




  • Prev by Date: Re: Is it possible to create a single csv file one row at a time using
  • Next by Date: Re: Re: Showing the Current Value of a Slider in Manipulate
  • Previous by thread: Re: Re: ImageSize->Full does not work as expected
  • Next by thread: Monitoring status of dynamic calculation