AHELP for CIAO 4.15 Sherpa

# histogram2d

Context: visualization

## Synopsis

Create 2D histogram from a sequence of samples.

## Syntax

```histogram2d(x, y, x_grid, y_grid)

x - sequence of numbers
y - sequence of numbers
x_grid - sequence of numbers
y_grid - sequence of numbers```

## Description

See the `numpy.histogram2d` routine for a version with more options.

## Example

Given a list of coordinates ( xvals , yvals ), bin them up so that they match the 5 by 10 pixel image data space. In this case the X grid is [1, 2, ..., 5] and the Y grid is [1, 2, .., 10].

```>>> dataspace2d([5, 10])
>>> (xgrid, ygrid) = get_axes()
>>> n = histogram2d(xvals, yvals, xgrid, ygrid)
>>> set_dep(n)```

### PARAMETERS

The parameters for this function are:

Parameter Definition
x The array of samples (X coordinate)
y The array of samples (Y coordinate), which must have the same size as the x sequence.
x_grid The X bin edges.
y_grid The Y bin edges.

### Return value

The return value from this function is:

y -- The number of samples in each histogram bin defined by the x_grid and y_grid arrays.

### Changed in CIAO 4.15

The x_grid and y_grid arguments are no-longer changed (sorted) by this routine.

## Bugs

See the bugs pages on the Sherpa website for an up-to-date listing of known bugs.

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_quality, set_data, set_quality, ungroup, unpack_ascii, unpack_data
filtering