Re: ImageMargins and Frame Labels
- To: mathgroup at smc.vnet.net
- Subject: [mg118250] Re: ImageMargins and Frame Labels
- From: Peter Pein <petsie at dordos.net>
- Date: Sun, 17 Apr 2011 19:15:47 -0400 (EDT)
- References: <ioeker$n3t$1@smc.vnet.net>
Am 17.04.2011 13:55, schrieb Gabriel Landi: > Fellow Mathematica users, > > I periodically encounter the same problem when producing Mathematica > graphics that will later be used in publications: > When the graph has tick marks or labels, the center of the framed plot > becomes asymmetric, which is terrible when you wish to publish your plot. > The problem is worse in the horizontal direction. > > Here is a simple example: > > graph = Plot[Sin[x], {x,0,Pi}, Frame->True, FrameLabel->{x,Sin[x]}] > > I have so far found two ways of solving this: > > 1) The brute force way: Include ImageMargins->{{0,x},{0,y}} and keep > adjusting x and y until you are satisfied. > > 2) Use a panel: > > Panel[graph, Background ->White, Alignment->Center]. > > You can then include a ImagePadding command in graph. But this is confusing > and I personally have never adapted well to it. > You also encounter problems with ImageSize and AspectRatio. Say, for > instance, you use ImageSize->500 in graph. Since the AspectRatio of graph is > by default GoldenRatio, this command adapts well to it. But the panel, on > the other hand, has AspectRatio -> 1 which means that you will need to > Specify some sort of command like ImageSize->{GoldenRatio 500, 500} in the > panel as well. > > Anyway, does someone know a smart way to produce symmetric graphics without > having all this trouble? > > Thanks in advance, > > Gabriel T. Landi Hi, is the result satisfactory when you add empty labels at the remaining 2 sides? Plot[Sin[x], {x, 0, Pi}, Frame -> True, FrameLabel -> {x, Sin[x], " ", " "}] Peter