healpy.projaxes.GnomonicAxes.spy¶
-
GnomonicAxes.
spy
(Z, precision=0, marker=None, markersize=None, aspect='equal', **kwargs)¶ Plot the sparsity pattern on a 2-D array.
Call signature:
spy(Z, precision=0, marker=None, markersize=None, aspect='equal', **kwargs)
spy(Z)
plots the sparsity pattern of the 2-D array Z.If precision is 0, any non-zero value will be plotted; else, values of will be plotted.
For
scipy.sparse.spmatrix
instances, there is a special case: if precision is ‘present’, any value present in the array will be plotted, even if it is identically zero.The array will be plotted as it would be printed, with the first index (row) increasing down and the second index (column) increasing to the right.
By default aspect is ‘equal’, so that each array element occupies a square space; set the aspect kwarg to ‘auto’ to allow the plot to fill the plot box, or to any scalar number to specify the aspect ratio of an array element directly.
Two plotting styles are available: image or marker. Both are available for full arrays, but only the marker style works for
scipy.sparse.spmatrix
instances.If marker and markersize are None, an image will be returned and any remaining kwargs are passed to
imshow()
; else, aLine2D
object will be returned with the value of marker determining the marker type, and any remaining kwargs passed to theplot()
method.If marker and markersize are None, useful kwargs include:
- cmap
- alpha
See also
imshow()
- For image options.
For controlling colors, e.g., cyan background and red marks, use:
cmap = mcolors.ListedColormap(['c','r'])
If marker or markersize is not None, useful kwargs include:
- marker
- markersize
- color
Useful values for marker include:
- ‘s’ square (default)
- ‘o’ circle
- ‘.’ point
- ‘,’ pixel
See also
plot()
- For plotting options