I want to create a legend for my plots (a mixture of RegionPlots and ContourPlots). The legend should show the meanins of colors as boxes with text in them and the meaning of contours as framed number with text besides it. The following code creates an ideal legend in a notebook, but as soon as I export it to .eps (for inclusion in LaTeX), it screws up and starts breaking lines in the last part (the Grid inside the Grid).
How can I prevent Mathematica from changing the appearance of the image upon export?
BoxSize = {6, 2};
boxImSize = 170;
legend = Grid[{{Graphics[{Thick, Lighter[Green, 0.3],
Rectangle[{0, 0}, BoxSize], Black,
Text[Style["Allowed by all", 14, Bold], Center] },
ImageSize -> boxImSize],
Graphics[{Thick, Lighter[Blue, 0.5], Rectangle[{0, 0}, BoxSize],
Black, Text[
Style["Excluded by \!\(\*SubscriptBox[\(m\), \(H\)]\)", 14,
Bold], Center] }, ImageSize -> boxImSize],
Graphics[{Thick, Darker[Orange, 0.3], Rectangle[{0, 0}, BoxSize],
Black, Text[
Style["Excluded by\n \[Mu] \[RightArrow] e \[Gamma]", 14,
Bold], Center] }, ImageSize -> boxImSize],
Graphics[{Thick, Red, Rectangle[{0, 0}, BoxSize], Black,
Text[Style[
"Excluded by\n \!\(\*SubscriptBox[\(m\), \(H\)]\) and \[Mu] \
\[Rule] e \[Gamma]", 14, Bold], Center] }, ImageSize -> boxImSize],
Graphics[{Thick, GrayLevel[0.8], Rectangle[{0, 0}, BoxSize],
Black, Text[
Style["Excluded by\n SUSY constraints ", 14, Bold],
Center] }, ImageSize -> boxImSize],
Grid[{{Invisible[""],
Text[Style[Framed[5.7], 12, Bold, Blue], Background -> White],
Text[Style[
"\!\(\*SuperscriptBox[\(10\), \(13\)]\)\[Times] B(\[Mu] \
\[Rule] e \[Gamma])", 12, Bold, Blue]],
Invisible[""]}, {Invisible[""],
Text[Style[Framed[124], 12, Bold, Black],
Background -> White],
Text[Style["\!\(\*SubscriptBox[\(m\), \(H\)]\) in GeV", 12,
Bold, Black]], Invisible[""]}}, Spacings -> 0.5,
Alignment -> {Left, Center}]
}}, Background -> None, Spacings -> 0, Alignment -> {Left, Top},
Frame -> True]
Rasterize@
in front ofGrid
. $\endgroup$GraphicsGrid
instead ofGrid
, but you will then need to tweak the spacings. $\endgroup$