Differences between revisions 2 and 3
Deletions are marked like this. | Additions are marked like this. |
Line 37: | Line 37: |
To plot the the model fits without the data just use iplot foldmodel instead of iplot data. To plot both models in model space the following can be used {{{ XSPEC12> plot model model second PLT> plot over PLT> view 0.1 0.1 0.9 0.9 PLT> col 2 on 2 }}} |
Plotting two models fit to a spectrum
Suppose we have separately fit two different models to a single spectrum and for illustrative purposes want to include them in the same plot. To do this we need to define two sources which we do as follows. Suppose the spectrum is example.pha and its response example.rsp. Then
XSPEC12> data example.pha XSPEC12> resp example.rsp XSPEC12> resp 2:1 example.rsp
This defines two sources, both using example.rsp as their response. We now load in both the models, with their parameter values as determined previously in the separate fits.
XSPEC12> model phabs(pow) ... XSPEC12> model 2:second phabs(pow + ga) ...
We now do the standard plot
XSPEC12> cpd /xs XSPEC12> iplot data PLT>
At this point the plot contains the data, the sum of the two models, and the two models. Obviously, we don't want the sum of the two models so we will set that to colour 0. We can also change the colour on the second model to make clear which is which
PLT> col 0 on 2 PLT> col 2 on 4
To plot the the model fits without the data just use iplot foldmodel instead of iplot data. To plot both models in model space the following can be used
XSPEC12> plot model model second PLT> plot over PLT> view 0.1 0.1 0.9 0.9 PLT> col 2 on 2