MathGroup Archive 2009

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

Search the Archive

Re: ItemSize and ImageSize->Full , I do not understand what happens

  • To: mathgroup at smc.vnet.net
  • Subject: [mg105314] Re: ItemSize and ImageSize->Full , I do not understand what happens
  • From: "Nasser M. Abbasi" <nma at 12000.org>
  • Date: Fri, 27 Nov 2009 06:30:24 -0500 (EST)

Just to add something.  What I really like to obtain is the same effect as 
the following command

Grid[{{

         Framed[ Plot[Sin[x], {x, -Pi, Pi},
                      Frame -> False,
                      ImageSize -> Scaled[1],
                      ImageMargins -> 0,
                      ImagePadding -> 0]
                     ]
       }},
       ItemSize -> 20, Frame -> All
]

You can see the image (plot here) completely fill all the space. This is 
what I want.

But without the use of Scaled[], and without having to specify a numerical 
value for the plot ImageSize or width and hight. i.e. by only giving the one 
numerical value for the ItermSize, and the rest should be done Automatically 
just like the above, but again, without the use of Scaled. This way, I only 
need to change one value and not worry about different combinations 
affecting each others.

I am still trying different options, but none seems to work as Scaled[1] 
does....

"Nasser M. Abbasi" <nma at 12000.org> wrote in message news:...
> Version 7
>
> One of the problems I always have with using Manipulate is getting the 
> plots and images to align and fit and have the sizes I want when they are 
> inside a Grid (or Column) and having the whole thing be of the right size 
> when everything is put togother.
>
> So, I am trying now to make a plot completely fill a given Grid or Column 
> cell (so that no empty space exist around the plot).
>
> I normally do this by playing around with the options ItemSize for the 
> Grid, and with ImageSize for the plot, and with AspectRatio for the plot 
> command, and with ImagePadding until I get the right size and layout looks 
> good.
>
> But I am finally decided to step back and see if I can find an easier way 
> than this trial and error method.
>
> One way to make an Image fit best inside a Grid or Column element is by 
> the use of Scaled[1], as in
>
> Column[{Plot[Sin[x], {x, -Pi, Pi}, ImageSize -> Scaled[1]]}, ItemSize -> 
> 20, Frame -> All]
>
> However, I do not want to use Scaled[] (for other reasons). So from the 
> help under ImageSize it says:
>
> "For an object that appears as an element in a Grid, ImageSize->Full 
> corresponds to the full width of the cell in the grid. "
>
> Sound good. So based on the above, if I use ImageSize->Full I should get, 
> what I thought, the same output or may be close to what I had with 
> Scaled[1], but something very weird happens instead:
>
> (be careful when using this command below, you'll notice strange output, 
> and the scroll bar will no longer work)
>
> Column[{Plot[Sin[x], {x, -Pi, Pi}, ImageSize -> Full]}, ItemSize -> 20, 
> Frame -> All]
>
> I do not understand why Mathematica did what it did. I am giving an 
> specific ItemSize and saying ImageSize->Full, so what is wrong with this?
>
> Thanks,
> --Nasser
> 



  • Prev by Date: ItemSize and ImageSize->Full , I do not understand what happens
  • Next by Date: Re: .NET/LINK USER GUIDE Comment: Calling
  • Previous by thread: Re: ItemSize and ImageSize->Full ,
  • Next by thread: Re: ItemSize and ImageSize->Full , I do not understand what happens