This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)
How to | Align Plots with Each Other
The Mathematica graphics language has many controls for preparing and laying out plots. Aligning plots is important when preparing graphics for presentation or publication.
Here are two plots of FinancialData plotted as a function of time:
Click for copyable input
If you want to compare the two plots, you can make a grid:
Click for copyable input
But the axes do not exactly line up, which makes it harder to make a useful comparison.
(Mathematica automatically draws the plot area as large as possible and gives only as much space to the axis labels as is necessary. Normally this is what you want, but not in this case.)
The solution is to set the padding for the plot manually with the ImagePadding option:
Click for copyable input
Now the axes on the plots line up:
Click for copyable input
You can also use ImagePadding to align plots in the horizontal as well as the vertical direction.