Re: scaling Plots to millimeters
- To: mathgroup at smc.vnet.net
- Subject: [mg38883] Re: scaling Plots to millimeters
- From: "Allan Hayes" <hay at haystack.demon.co.uk>
- Date: Fri, 17 Jan 2003 05:38:47 -0500 (EST)
- References: <b05q70$28h$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Adalbert, I hope that the following may be of help - I am using the default style sheet. Define the multiplier to convert printers' points to mm. mm = 72/25.4; Set, for image size, isx = 100*mm; isy = 150*mm; Consider, gr = Show[Graphics[{Line[{{0, 0}, {10, 10}}]}, Frame -> True, FrameStyle -> AbsoluteThickness[5], PlotRange -> {{0, 10}, {0, 10}}, ImageSize -> {isx, isy}, FrameTicks -> False, AspectRatio -> 0.5]]; The frame, with aspect ratio 1/2, is made as big as possible inside, and centered in, the bounding box (shown by clicking the picture). 1) For the frame to fill the bounding box, and so have the same dimensions, we must give it the same aspect ratio as the bounding box (alternatively give the cell the cell option, AspectRatioFixed->False). Show[gr, AspectRatio -> isy/isx]; 2) Unfortunately, the printed form will not have the dimensions {isx, isy}, it will be 0.8 of this. This is because in the style sheet Styles for Input/Output >Prototype for style: "Graphics" > Modification for style "Graphics" in style environment "Printout"; we find Maginfication -> 0.8. Changing this to Magnification -> 1 will make all the graphics in notebooks with this style sheet print with the "correct" dimensions (for safety import a private style sheet). Alternatively we can add the cell option Magnification -> 1 to the cell expressions of the graphics cells that we want to print to correct dimensions. 3) There remains one more problem. You will see below that although the frame's aspect ratio stays the same (1/2}, it has now to make way for the labels. This could require more experimenting. Show[gr, AspectRatio -> isy/isx, FrameTicks -> {True, True, False, False}, DefaultFont -> {"Courier", 48}, PlotLabel -> StyleForm["Label", FontSize -> 48]]; "Adalbert Hanssen" <hanssen at zeiss.de> wrote in message news:b05q70$28h$1 at smc.vnet.net... > Hi, MathGroup, > > I want to print a plot scaled to a specific size. > According to the online help, ImageSize->72 xi specifies that the image should have a width of xi inches. > In order to enter sizes in mm, I try: > > xUmr=yUmr=72/25.4; > Show[Graphics[{Line[{{0,0},{0,1},{1,1},{1,0},{0,0}}]}] > ,Ticks->None > ,ImageSize->150*{xUmr,yUmr} > ,PlotRange->{{0,1},{0,1}} > ]; > > and get a printed rectangle about 119 mm wide and 74 mm high. > > I am wondering, why the area is non square, since I gave > two PlotRanges and two ImagsSizes. > > Only, if I use AspectRatio in addition, I get something closer, to what I want: > > xUmr=yUmr=72/25.4; > Show[Graphics[{Line[{{0,0},{0,1},{1,1},{1,0},{0,0}}]}] > ,Ticks->None > ,ImageSize->150*{xUmr,yUmr} > ,PlotRange->{{0,1},{0,1}} > ,AspectRatio->1 > ]; > > gives a rectayngle 119.5*119 mm where I expected 150*150. > Ok, the printer is somehow misbehaving, then I set > > xUmr=150/119.5*72/25.4; > yUmr=150/119.0*72/25.4; > > to obtain almost a square. > > Any explanation, why AspectRatio is necessary? > > regards > > Adalbert > > >