sherpa.astro.ui.dataspace2d(dims, id=None, dstype=<class ''>)

Create the independent axis for a 2D data set.

Create an “empty” two-dimensional data set by defining the grid on which the points are defined (the independent axis). The values are set to 0.

  • dims (sequence of 2 number) – The dimensions of the grid in (width,height) order.

  • id (int or str, optional) – The identifier for the data set to use. If not given then the default identifier is used, as returned by get_default_id.

  • dstype (data class to use, optional) – What type of data is to be used. Supported values include DataIMG (the default), Data2D, and Data2DInt.

See also


Create the independent axis for a 1D data set.


Return the dependent axis of a data set.


Return the independent axes of a data set.


Set the dependent axis of a data set.


Create a 200 pixel by 150 pixel grid (number of columns by number of rows) and display it (each pixel has a value of 0):

>>> dataspace2d([200, 150])
>>> image_data()

Create a data space called “fakeimg”:

>>> dataspace2d([nx, ny], id="fakeimg")