/ sherpa4.16 / faq / plot_multi_mpl.html
This page is for the obsolete Sherpa 4.16 release. Please see the Sherpa home page for the latest release.
How can I adjust multiple plots with matplotlib?
Once multiple plots have been created thet can be adjusted using Matplotlib. For example, the vertical spacing between two plots can be adjusted
sherpa> plot("data", 1, "data", 2) sherpa> plt.subplots_adjust(hspace=0.5)
Increasing the vertical space between the plots
If more than two plots are created then multiple columns will be used:
sherpa> plot('fit', 1, 'fit', 2, 'delchi', 1, 'delchi', 2) sherpa> fig = plt.gcf() sherpa> for i in [0, 1]: ...: fig.axes[i].xaxis.label.set_visible(False) ...: fig.axes[i].xaxis.set_ticklabels([]) ...: fig.axes[i].set_ylim(1e-4, 2e-1) ...: sherpa> for i in [2, 3]: ...: fig.axes[i].title.set_visible(False) ...: fig.axes[i].set_ylim(-4, 4) ...: sherpa> for i in [1, 3]: ...: fig.axes[i].yaxis.label.set_visible(False) ...: fig.axes[i].yaxis.set_ticklabels([]) ...: sherpa> plt.subplots_adjust(hspace=0.05, wspace=0.05)
Adjusted plot
/ sherpa4.16 / faq / plot_multi_mpl.html