3
$\begingroup$

There are some solutions on how to make nice panel figures, for example, or the SciDraw package. By nice, I mean reasonably presentable - without miles of space in between figures, and plots within the panel have consistent sizes and fonts, and the labels are inline from plot to plot. I'm not asking for much.

However, I wantinclude a panel figure which has a 3D plot in it. I'm finding it very difficult with the padding in GraphicsGrid. For example,

plot1 = Plot3D[Sin[x/100 + y^2], {x, -300, 300}, {y, -2, 2}, 
   ColorFunction -> "RedBlueTones", Boxed -> False , 
   LabelStyle -> {FontSize -> 13, FontFamily -> "Helvetica", Black}, 
   AxesLabel -> {"x axis label", "y axis label", "z value", " "}, 
   PlotLabel -> "3D Map", 
   ViewPoint -> {1.9660038626106877, 2.036484683486844, 
     1.8540655182930692}, 
     ViewVertical -> {-0.38056099743618316, -0.39420402835939466, 
     0.836526455801371}];

plot2 = DensityPlot[Sin[x/100 + y^2], {x, -300, 300}, {y, -2, 2}, 
   PlotRange -> All, PlotPoints -> 200, 
   ColorFunction -> "RedBlueTones", PlotLabel -> "Density Plot", 
   FrameLabel -> {{"x axis label", " "}, {"y axis label", " "}}, 
   LabelStyle -> {FontSize -> 13, FontFamily -> "Helvetica", Black}];

plot3 = Plot[{Sin[x/100 + 0]}, {x, -300, 300}, PlotRange -> All, 
   Frame -> True, FrameLabel -> {"y axis label", " z label"}, 
   AspectRatio -> 1, 
   LabelStyle -> {FontSize -> 13, FontFamily -> "Helvetica", Black}, 
   PlotLabel -> "x axis cut"];
plot4 = Plot[{Sin[0 + y]}, {y, -2, 2}, PlotRange -> All, 
   Frame -> True, FrameLabel -> {"x axis label", " z label"}, 
   AspectRatio -> 1, 
   LabelStyle -> {FontSize -> 13, FontFamily -> "Helvetica", Black}, 
   PlotLabel -> "y axis cut"];


GraphicsGrid[{{plot1, plot2}, {plot3, plot4}}, 
 ImageSize -> {1000, 1000}]

You can see the output, each plot is a different size, with massive gaps between the figures. I've played about with padding on GraphicsGrid, but that hasn't been very helpful. The titles are at different heights. It doesn't look great. Any suggestions on improvements?

enter image description here

$\endgroup$
1
  • $\begingroup$ Try: AspectRatio->1 $\endgroup$ Commented Apr 7, 2021 at 15:53

1 Answer 1

3
$\begingroup$
Clear["Global`*"]

I recommend that in plot1 use the option AxesEdge to keep the axes up front; add the option ImageSize to each plot; and use Grid rather than GraphicsGrid.

plot1 = Plot3D[Sin[x/100 + y^2],
   {x, -300, 300}, {y, -2, 2},
   ColorFunction -> "RedBlueTones",
   Boxed -> False,
   LabelStyle -> {FontSize -> 13, FontFamily -> "Helvetica", Black},
   AxesLabel -> {"x axis label", "y axis label", "z value", " "},
   PlotLabel -> "3D Map",
   ViewPoint -> {1.9660038626106877, 2.036484683486844, 1.8540655182930692},
   ViewVertical -> {-0.38056099743618316, -0.39420402835939466, 
     0.836526455801371},
   ImageSize -> 360,
   AxesEdge -> {{1, -1}, {1, -1}, {1, -1}}];

plot2 = DensityPlot[Sin[x/100 + y^2],
   {x, -300, 300}, {y, -2, 2},
   PlotRange -> All,
   PlotPoints -> 200,
   ColorFunction -> "RedBlueTones",
   PlotLabel -> "Density Plot",
   FrameLabel -> {{"x axis label", " "}, {"y axis label", " "}},
   LabelStyle -> {FontSize -> 13, FontFamily -> "Helvetica", Black},
   ImageSize -> 360];

plot3 = Plot[{Sin[x/100 + 0]}, {x, -300, 300},
   PlotRange -> All,
   Frame -> True,
   FrameLabel -> {"y axis label", " z label"},
   AspectRatio -> 1,
   LabelStyle -> {FontSize -> 13, FontFamily -> "Helvetica", Black},
   PlotLabel -> "x axis cut",
   ImageSize -> 360];

plot4 = Plot[{Sin[0 + y]}, {y, -2, 2},
   PlotRange -> All,
   Frame -> True,
   FrameLabel -> {"x axis label", " z label"},
   AspectRatio -> 1,
   LabelStyle -> {FontSize -> 13, FontFamily -> "Helvetica", Black},
   PlotLabel -> "y axis cut",
   ImageSize -> 360];

Combining

Grid[{{plot1, plot2}, {plot3, plot4}}]

enter image description here

$\endgroup$
4
  • $\begingroup$ @Tomi - Look at your labels on the DensityPlot, the form is FrameLabel -> {{left, right}, {bottom, top}} $\endgroup$
    – Bob Hanlon
    Commented Apr 7, 2021 at 15:51
  • $\begingroup$ This is a great help. But, I won't accept as the answer, for two reasons - see how the plot labels on plot1 and 2 are misaligned? and the "squares" of the plot are still different sizes and thus also misaligned? I will see if it is possible to improve on these and report back. $\endgroup$
    – Tomi
    Commented Apr 7, 2021 at 15:52
  • $\begingroup$ To make the box for plot1 the same as plot2 use BoxRatios -> {1, 1, 1} in plot1; however, the plot looks odd to me like that. Alternatively, remove the PlotLabel from plot1 and plot2 and add the plot labels as a separate first row in the Grid. $\endgroup$
    – Bob Hanlon
    Commented Apr 7, 2021 at 16:05
  • $\begingroup$ Solved the title problem. The difficulty is now aligning 'plot2' and 'plot4' (or the top and bottom rows) – Tomi 40 mins ago $\endgroup$
    – Tomi
    Commented Apr 7, 2021 at 16:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.