pynbody.plot.generic.make_contour_plot

pynbody.plot.generic.make_contour_plot#

pynbody.plot.generic.make_contour_plot(arr, xs, ys, x_range=None, y_range=None, nlevels=20, logscale=True, xlogrange=False, ylogrange=False, subplot=False, colorbar=False, ret_im=False, cmap=None, clear=True, legend=False, scalemin=None, levels=None, scalemax=None, filename=None, **kwargs)[source]#

Plot a contour plot of grid arr corresponding to bin centers specified by xs and ys. Labels the axes and colobar with proper units taken from x

Called by hist2d() and gauss_density().

Input:

arr: 2D array to plot

xs: x-coordinates of bins

ys: y-coordinates of bins

Optional Keywords:

x_range: list, array, or tuple (default = None)

size(x_range) must be 2. Specifies the X range.

y_range: tuple (default = None)

size(y_range) must be 2. Specifies the Y range.

xlogrange: boolean (default = False)

whether the x-axis should have a log scale

ylogrange: boolean (default = False)

whether the y-axis should have a log scale

nlevels: int (default = 20)

number of levels to use for the contours

logscale: boolean (default = True)

whether to use log or linear spaced contours

colorbar: boolean (default = False)

draw a colorbar

scalemin: float (default = arr.min())

minimum value to use for the color scale

scalemax: float (default = arr.max())

maximum value to use for the color scale