This page is for the obsolete Sherpa 4.16 release. Please see the Sherpa home page for the latest release.
How can I include multiple datasets in the same plot?
Sherpa provides some support for plotting multiple datasets together, as discussed here. It is also possible to add data using the plotting backend, such as with the Matplotlbi examples.
In the following we assume you have two data sets loaded with ids of 1 (i.e. the default) and 2, that you have done the following
and that fits have been made to both data sets.
If you wish to display multiple datasets in the same plot then you have to set the overplot argument to True; for example if you have two datasets with ids of 1 and 2 then:
sherpa> plot_data(alpha=0.6) sherpa> plot_data(2, alpha=0.6, overplot=True)
will display the two data sets in the same plot, with the second dataset drawn in orange. Note that the plot title is not changed when extra datasets are added.
Overplotting different data sets
You can overplot data from the same data set; for instance if you want the residuals shown on the same graph as the data you could say
sherpa> plot_fit(ylog=False) sherpa> plot_resid(overplot=True, marker='s', markersize=3, alpha=0.5)
Overplotting residuals
You can overlay fits, with the choice of colors depending on the plot backend:
sherpa> plot_fit(1, alpha=0.5) sherpa> plot_fit(2, alpha=0.5, overplot=True)