Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2009

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

Search the Archive

How to resize elements in GraphicsGrid

  • To: mathgroup at smc.vnet.net
  • Subject: [mg99864] How to resize elements in GraphicsGrid
  • From: dch888 <dch888 at googlemail.com>
  • Date: Sat, 16 May 2009 18:25:01 -0400 (EDT)

Hi Mathematica Folks,

I'm trying to write a Mathematica program which will draw a Leopold Matrix.
This is used in environmental science.  I've managed to create a
program which does indeed draw the matrix but there is just one
problem - I can't seem to scale the final output properly.  If I draw
the graphic and make it smaller the individual elements in the
GraphicsGrid don't resize properly.  I've tried making the inidivual
items in the grid smaller to start with (with the variable 'cellsize')
but oddly that seems to have little effect.

If someone could have a quick look over my code and make some
suggestions I'd be VERY grateful!  Otherwise when I run the program
with the full set of data (something like 20 x 20) the output is going
to be gargantuan.  A simple operation in Mathematica to scale down the whole
output would be ok.

Many thanks,
David.

Code:
=====================================

cellsize=0.125;
cell[x_,y_]=Graphics[
{
Line[{{0,0},{cellsize,cellsize}}],
Text[Style[x,Large,Bold,Black],{cellsize/4,3cellsize/4}],
Text[Style[y,Large,Bold,Black],{3cellsize/4,cellsize/4}]
}
];

word[x_]=Graphics[
{Text[Style[x,Large,Bold,Black],{0,cellsize/2}]
}
];

vword[x_]=Graphics[
{Rotate[
Text[Style[x,Large,Bold,Black],{0,cellsize/2}],
90Degree]
}
];


uppers={1,3,5,7,9,11,13,15,G};

lowers={2,4,6,8,10,12,14,F,H};


vlabels1={aardvark,beowulf,church};
vlabels2={dragon,earwig,flimflam};
vlabels3={greengrocer,hello,indigo};

hlabels1={Angstrom,Beeblebox,Chatterbox};
hlabels2={Dribble,Elongated,Freddy};
hlabels3={Glue,Hulaballo,Iridescant};

g=Grid[Table[
cell[
uppers[[3(i-1)+j]],
lowers[[3(i-1)+j]]
],
{i,3},{j,3}
],
{Spacings->{0,0},Frame->All}
];

hl=Grid[Table[
List[
word[vlabels1[[i]]],
word[vlabels2[[i]]],
word[vlabels3[[i]]]
],{i,3}
],
{Spacings->{0,0},Frame->All}
];

vl=Grid[Table[
List[
vword[hlabels1[[i]]],
vword[hlabels2[[i]]],
vword[hlabels3[[i]]]
],{i,3}
],
{Spacings->{0,0},Frame->All}
];

spaces=Grid[Table[
List[
Graphics[Text[" "]],
Graphics[Text[" "]],
Graphics[Text[" "]]
],{i,3}
],
{Spacings->{0,0}}
];

GraphicsGrid[{{spaces,vl},{hl,g}},ImageSize->Tiny]


  • Prev by Date: Re: Problems in fitting the experimental data with the expression
  • Next by Date: Re: Wolfram|Alpha Lookup Tool for Mathematica
  • Previous by thread: Re: Problems in fitting the experimental data with the expression
  • Next by thread: Re: How to resize elements in GraphicsGrid