Synopsis
Create a contour plot for an image data set.
Syntax
contour(*args, **kwargs)
Description
Create one or more contour plots, depending on the arguments it is set: a plot type, followed by an optional data set identifier, and this can be repeated. If no data set identifier is given for a plot type, the default identifier - as returned by `get_default_id` - is used. This is for 2D data sets.
Examples
Example 1
>>> contour('data')
Example 2
>>> contour('data', 1, 'data', 2)
Example 3
>>> contour('data', 'model')
Example 4
>>> contour('data', 'model', 'fit', 'resid')
Example 5
>>> contour('data', 'model', alpha=0.7)
Example 6
Use a single column rather than single row to display the contour plots:
>>> contour('data', 'model', cols=1)
PARAMETERS
The parameters for this function are:
Parameter | Definition |
---|---|
args | The contour-plot names and identifiers. |
rows | The number of rows and columns (if set). |
cols | The number of rows and columns (if set). |
kwargs | The plot arguments applied to each contour plot. |
Notes
The supported plot types depend on the data set type, and include the following list. There are also individual functions, with contour_ prepended to the plot type, such as `contour_data` and the `contour_fit_resid` variant:
Item | Definition |
---|---|
data | The data. |
fit | Contours of the data and the source model. |
fit_resid | Two plots: the first is the contours of the data and the source model and the second is the residuals. |
kernel | The kernel. |
model | The source model including any PSF convolution set by `set_psf` . |
psf | The PSF. |
ratio | Contours of the ratio image, formed by dividing the data by the model. |
resid | Contours of the residual image, formed by subtracting the model from the data. |
source | The source model (without any PSF convolution set by `set_psf` ). |
The keyword arguments are sent to each plot (so care must be taken to ensure they are valid for all plots).
Changes in CIAO
Changed in CIAO 4.17
The keyword arguments can now be set per plot by using a sequence of values. The layout can be changed with the rows and cols arguments and the automatic calculation no longer forces two rows. Handling of the overcontour flag has been improved.
Changed in CIAO 4.13
Keyword arguments, such as alpha, can be sent to each plot.
Bugs
See the bugs pages on the Sherpa website for an up-to-date listing of known bugs.
See Also
- data
- copy_data, dataspace1d, dataspace2d, datastack, delete_data, fake, get_axes, get_bkg_chisqr_plot, get_bkg_delchi_plot, get_bkg_fit_plot, get_bkg_model_plot, get_bkg_plot, get_bkg_ratio_plot, get_bkg_resid_plot, get_bkg_source_plot, get_counts, get_data, get_data_contour, get_data_contour_prefs, get_data_image, get_data_plot, get_data_plot_prefs, get_dep, get_dims, get_error, get_quality, get_specresp, get_staterror, get_syserror, group, group_adapt, group_adapt_snr, group_bins, group_counts, group_snr, group_width, load_ascii, load_data, load_grouping, load_image, load_quality, pack_image, set_data, set_quality, ungroup, unpack_ascii, unpack_data, unpack_image
- filtering
- get_filter, load_filter, set_filter
- info
- get_default_id, list_data_ids, list_response_ids
- modeling
- clean, image_model, image_model_component, image_source, image_source_component
- plotting
- get_split_plot, plot_data, set_xlinear, set_xlog, set_ylinear, set_ylog
- psfs
- contour_kernel, contour_psf, image_kernel
- saving
- save_error, save_filter, save_grouping, save_quality, save_staterror, save_syserror
- utilities
- calc_data_sum, calc_data_sum2d, calc_ftest, calc_kcorr, calc_mlr, calc_model_sum2d, calc_source_sum2d, get_rate
- visualization
- contour_data, contour_fit, contour_fit_resid, contour_model, contour_ratio, contour_resid, contour_source, histogram1d, histogram2d, image_close, image_data, image_deleteframes, image_fit, image_getregion, image_open, image_ratio, image_resid, image_setregion, image_xpaget, image_xpaset, rebin