I have a list of graphics which are all the same width, and I would like to combine them into a single Graphics object that has them all stacked on top of each other, column-style, without changing their widths. The help page for GraphicsColumn lists Alignment->Full
as the option that would do that, but I'm having some trouble implementing it.
To take one of the examples in the help page, entering
GraphicsColumn[Table[Graphics[Disk[], ImageSize -> 10 i], {i, 1, 5}],
Alignment -> Center, Frame -> All]
will produce the following column.
I would expect changing Alignment->Center
to Alignment->Full
to provide a column with five circles of equal width. Instead, it returns the error message
GraphicsGrid::optv: "Value of option Alignment->Full in GraphicsGrid[{{ [...] },{ [...] },{ [...] },{ [...] },{ [...] }},Alignment->Full,Frame->All] is not valid. "
This seems to me to be a bug, which came up here/here, and which I will report shortly. I am running Mathematica 9.0.1.0 on Linux x86 (64-bit), Ubuntu 12.04.3 LTS; I also observe the error on Mathematica 9.0.0.0 over Widows 7.
In the meantime, is there a practicable workaround?
To provide a bit more detail: the circles above are a MWE; my actual problem is more complicated. I have a table of similar plots, some of which have "stuff" on top added in using FrameTicks
. A MWE that's closer to my actual situation is
GraphicsColumn[{
ContourPlot[x^2 - y^2, {x, -2, 2}, {y, -2, 2}, ImageSize -> 200,
PlotLabel -> Graphics[Circle[], ImageSize -> 100]],
ContourPlot[x^2 - y^2, {x, -2, 2}, {y, -2, 2}, ImageSize -> 200]
}]
The objects in the question are a MWE, my actual problem is more complicated. I have a table of objects which are already the same widths (and therefore the same ImageSize
s), but they have different aspect ratios. Setting their ImageSize
s constant would not do anything.
Perhaps a more representative example of my situation is:
GraphicsColumn[Table[Graphics[Rectangle[{0, 0}, {1, i}]], {i, 1, 5}],
Alignment -> Center, Frame -> All]
Column[Show[#, ImageSize -> {50, Automatic}] & /@ Table[Graphics[Rectangle[{0, 0}, {1, i}]], {i, 1, 5}], Alignment -> Center, Frame -> All]
(let's delete not important comments) $\endgroup$Automatic
toFull
withinShow
the correct behaviour is obtained, modulo the spacings. I'll be happy to accept such an answer. $\endgroup$Rasterize
. $\endgroup$