MathGroup Archive 2008

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

Search the Archive

Re: GraphicsGrid spacing

  • To: mathgroup at smc.vnet.net
  • Subject: [mg94403] Re: GraphicsGrid spacing
  • From: janeywit <janeywit at gmail.com>
  • Date: Fri, 12 Dec 2008 06:53:42 -0500 (EST)
  • References: <200812100951.EAA00449@smc.vnet.net> <ghqk36$17p$1@smc.vnet.net>

Thank you both for replying!  The AspectRatio -> 3 solution worked for
a while but then I ran into more problems with other changes I made.
In the end I made it work with various options including ImagePadding
and AspectRatios.  And I learned a lot from the example posted here so
thank you!

On Dec 11, 8:47 am, "Scot Martin" <smar... at seas.harvard.edu> wrote:
> I don't really understand GraphicsColumn and GraphicsGrid myself because =
the
> formatting also comes out strange every time I try to use them for my
> purposes. However, Grid and Column work just great. Here's an example of =
how
> I put a graphic exactly where I want on an 8.5 by 11" piece of paper. The
> key commands (from my point of view) are Column[], Inset[], and
> ImagePadding[]. In particular, ImagePadding[] is in my list of top 10
> commands added to Mathematica in recent years, though Column[] and Inset[=
]
> are probably the commands you're after.
>
> I'll paste "everything" below in case you want to try these out in
> Mathematica so that you won't be missing any commands.
>
> Needs["BarCharts`"]
>
> SetOptions[BarChart,FrameLabel->{{"Mass Loading (\[Mu]g m^-3
> bin^-1)",},{"Aerodynamic Diameter (\[Mu]m)",""}},ImageSize->5
> 72,ImagePadding->{{48,16},{88,8}},BaseStyle->{FontSize->12,FontFamily->"T=
ime
> sNewRoman"},Frame->True,FrameTicks->{{Automatic,None},{Automatic,None}},B=
arS
> tyle->Red];
>
> labels={"<0.09","0.09\nto\n0.18","0.18\nto\n0.33","0.33\nto\n0.56","0.5=
6\nto
> \n1.00","1.00\nto\n1.80","1.80\nto\n3.2","3.20\nto\n10.0","10.0\nto\n18.0=
"};
>
> loadings["biomass"]={2.000,12.184,27.161,59.134,32.007,6.832,3.803,9.39=
0,1.3
> 46};
>
> out["biomass"]=BarChart[loadings["biomass"],BarLabels->labels,Epilog->{=
Inset
> ["Rond=F4nia",Scaled[{.7,.9}],{-1,0}],Inset["21 Sep
> 2002",Scaled[{.7,.8}],{-1,0}]}]/.(FrameTicks->{bottom_List,_})->(FrameTic=
ks-
>
> >{{Automatic,None},{bottom,None}})
>
> loadings["AMAZE"]={{0,0.917,0.955,0.723,0.626,0.965,2.842,4.564,0.839},=
{0.61
> 6,0.296,0.551,0.611,0.421,1.627,2.013,4.189,0.474},{0.272,0.738,0.331,0.5=
90,
> 1.931,1.008,1.466,3.977,0.414}}
>
> out["AMAZE"]=BarChart[loadings["AMAZE"],BarLabels->labels,Epilog->{Inse=
t["AM
> AZE-08",Scaled[{.1,.9}],{-1,0}],Inset["Mar-Apr
> 2008",Scaled[{.1,.8}],{-1,0}]}]/.(FrameTicks->{bottom_List,_})->(FrameTic=
ks-
>
> >{{Automatic,None},{bottom,None}})
>
> out["page"]=Graphics[{Inset[Column[{out["AMAZE"],"","",out["biomass"]}]=
,Cent
> er]},ImageSize->72{8.5,11}]
>
> SetDirectory[NotebookDirectory[]];
> Export["MOUDI.pdf",out["page"]]
>
> -----Original Message-----
> From: janeywit [mailto:janey... at gmail.com]
> Sent: Wednesday, December 10, 2008 4:52 AM
> Subject:  GraphicsGrid spacing
>
> Hi,
> I have 2 box whisker plot images and I'd like to place one above the
> other in a GraphicsColumn format.   This seems to work fine if the box
> whisker plot images only contain a small number of plots, but mine
> contain a lot of plots (i.e. they are very wide) and when I put them
> in the GraphicsColumn mathematica places a huge amount of white space
> around them.  I want to export the image to disk and at the moment it
> is half whitespace.
> I have tried every possible option of spacing and sizing that I can
> think of and can't find a way to improve it.  Please can somebody help
> me - otherwise I have to export the image and then alter it with Paint
> or something which is really not what I want to do.
> Many thanks in advance!
>
> Here is an example of what I mean:
>
> Needs["StatisticalPlots`"]
> list1 = {1, 3, 4, 5, 3, 5, 6, 4, 6, 7, 4, 6, 5, 3, 2}
> list2 = {7, 6, 7, 8, 6, 5, 7, 7, 6, 5, 4, 4, 6, 6, 4, 3}
> bwp1 = BoxWhiskerPlot[list1, list2, PlotRange -> {Automatic, All}]
> bwp2 = BoxWhiskerPlot[list1, list2, PlotRange -> {Automatic, {0, 5}}]
>
> (*Put two small images in a column.... it works fine*)
> GraphicsColumn[{bwp1, bwp2}]
>
> (*Now make larger images to test with*)
> bwp11 = BoxWhiskerPlot[list1, list2, list1, list2, list1, list2,
>   list1, list2, list1, list2, list1, list2,
>   PlotRange -> {Automatic, All}]
> bwp22 = BoxWhiskerPlot[list1, list2, list1, list2, list1, list2,
>   list1, list2, list1, list2, list1, list2,
>   PlotRange -> {Automatic, {0, 5}}]
>
> (*Now put the larger images in a column - a huge amount of whitespace
> appears around the images*)
> GraphicsColumn[{bwp11, bwp22}]



  • Prev by Date: RE: Clever way to manipulate lists
  • Next by Date: RE: Re: A 3D Plot Query
  • Previous by thread: Re: GraphicsGrid spacing
  • Next by thread: Re: GraphicsGrid spacing