pynbody.plot.generic.prob_plot#
- pynbody.plot.generic.prob_plot(x, y, weight, nbins=(100, 100), extent=None, return_array=False, **kwargs)[source]#
Make a plot of the probability of y given x, i.e. p(y|x).
The values are normalized such that the integral along each column is one.
Changed in version 2.0: The axes keyword has been removed for consistency with other functions. If you want to plot on specific axes, select those axes first using the matplotlib interface.
This routine no longer returns the arrays used for plotting unless specifically requested using the return_array keyword.
- Parameters:
x (array-like) – primary binning axis
y (array-like) – secondary binning axis
weight (array-like) – weights array
nbins (tuple of length 2) – number of bins in each direction
extent (tuple of length 4) – physical extent of the axes (xmin,xmax,ymin,ymax)
return_array (bool) – If True, return the array used to make the plot.
**kwargs – all optional keywords are passed on to the imshow() command
- Returns:
If *return_array is True, return the arrays used to make the plot in the order*
*grid, *xbinedges*, *ybinedges*. Otherwise, returns None.*