galpy.util.plot.scatterplot

galpy.util.plot.scatterplot(x, y, *args, **kwargs)[source]

Make a ‘smart’ scatterplot that is a density plot in high-density regions and a regular scatterplot for outliers.

Parameters:
  • x (numpy.ndarray) – x data.

  • y (numpy.ndarray) – y data.

  • xlabel (str, optional) – x-axis label, LaTeX math mode, no $s needed.

  • ylabel (str, optional) – y-axis label, LaTeX math mode, no $s needed.

  • xrange (tuple, optional) – x range to plot over.

  • yrange (tuple, optional) – y range to plot over.

  • bins (int, optional) – Number of bins to use in each dimension.

  • weights (numpy.ndarray, optional) – Data-weights.

  • aspect (float, optional) – Aspect ratio.

  • conditional (bool, optional) – Normalize each column separately (for probability densities, i.e., cntrmass=True).

  • overplot (bool, optional) – If True, overplot.

  • gcf (bool, optional) – Do not start a new figure (does change the ranges and labels).

  • contours (bool, optional) – If False, don’t plot contours.

  • justcontours (bool, optional) – If True, only draw contours, no density.

  • cntrcolors (str or list, optional) – Color of contours (can be array as for dens2d).

  • cntrlw (float, optional) – Linewidths for contour.

  • cntrls (str, optional) – Linestyles for contour.

  • cntrSmooth (float, optional) – Use ndimage.gaussian_filter to smooth before contouring.

  • levels (numpy.ndarray, optional) – Contour-levels; data points outside of the last level will be individually shown (so, e.g., if this list is descending, contours and data points will be overplotted).

  • onedhists (bool, optional) – If True, make one-d histograms on the sides.

  • onedhistx (bool, optional) – If True, make one-d histograms on the side of the x distribution.

  • onedhisty (bool, optional) – If True, make one-d histograms on the side of the y distribution.

  • onedhistcolor (str, optional) – Color of one-d histograms.

  • onedhistfc (str, optional) – Facecolor of one-d histograms.

  • onedhistec (str, optional) – Edgecolor of one-d histograms.

  • onedhistxnormed (bool, optional) – Normed keyword for one-d histograms.

  • onedhistynormed (bool, optional) – Normed keyword for one-d histograms.

  • onedhistxweights (numpy.ndarray, optional) – Weights keyword for one-d histograms.

  • onedhistyweights (numpy.ndarray, optional) – Weights keyword for one-d histograms.

  • cmap (matplotlib.colors.Colormap, optional) – Colormap for density plot.

  • hist (numpy.ndarray, optional) – You can supply the histogram of the data yourself, this can be useful if you want to censor the data, both need to be set and calculated using scipy.histogramdd with the given range.

  • edges (numpy.ndarray, optional) – You can supply the histogram of the data yourself, this can be useful if you want to censor the data, both need to be set and calculated using scipy.histogramdd with the given range.

  • retAxes (bool, optional) – Return all Axes instances.

Returns:

Plot to output device, Axes instance(s) or not, depending on input.

Return type:

Axes or tuple

Notes

  • 2010-04-15 - Written - Bovy (NYU)