Re: Aligning ListPlots
- To: mathgroup at smc.vnet.net
- Subject: [mg77158] Re: [mg77111] Aligning ListPlots
- From: Carl Woll <carlw at wolfram.com>
- Date: Tue, 5 Jun 2007 06:33:46 -0400 (EDT)
- References: <200706040745.DAA06030@smc.vnet.net>
Jan Rychter wrote: >I always thought it to be a big omission in Mathematica that there was >no facility for easily aligning multiple plots in a grid or column. Now, >with the arrival of Mathematica 6, we finally have GraphicsGrid, >GraphicsColumn and GraphicsRow! > >But -- I find those are essentially useless. When I build a >GraphicsColumn composed of multiple ListPlots, the vertical axes are NOT >aligned. Instead, Mathematica chooses to align the text labels on the >axes. Because of this, examples in the manual look just fine, because >labels on all the graphs are of the same length. But if you have, say, >two ListPlots, and one has labels in the range 1..5 and the other in the >range 10,000..100,000, the vertical axes will not align and the whole >column will look bad. > >Does anyone know of a solution to this? > >thanks, >--J. > > Look up ImagePadding in the help: ?ImagePadding ImagePadding is an option for graphics functions that specifies what \ absolute extra padding should be left for extended objects such as \ thick lines and annotations such as tick and axis labels. Here are two examples: padding = {{80, 10}, {30, 10}}; GraphicsGrid[{{Plot[x^2, {x, 0, 5}, ImagePadding -> padding]}, {Plot[ 100000 x^2, {x, 0, 5}, ImagePadding -> padding]}}] GraphicsColumn[{Plot[x^2, {x, 0, 5}], Plot[100000 x^2, {x, 0, 5}]} /. Graphics[a_, b_List] :> Graphics[a, Append[b, ImagePadding -> padding]]] Carl Woll Wolfram Research
- References:
- Aligning ListPlots
- From: Jan Rychter <jan@rychter.com>
- Aligning ListPlots