plot_density_scatter

sitelle.plot.plot_density_scatter(xdat, ydat, xlims=None, ylims=None, ax=None, bins=[100, 100], colorbar=True)

Helper to plot a density scatter plot.

Parameters:
  • xdat (1D ndarray) – X coordinates of the data
  • ydat (1D ndarray) – Y coordinates of the data
  • xlims (tuple of float) – (Optional) Limits to use on xdat
  • ylims (tuple of float) – (Optional) Limits to use on ydat
  • ax (Axes) – (Optional) The matplotlib axes on which to plot. If None, a new one will be created.
  • bins (list of int) – (Optional). The binning to use on each axis. Default = [100,100]
  • colorbar (bool, Default = True) – (Optional) If True, the colorbar is displayed.
Returns:

  • fig (Figure) – The figure containing the plot.
  • ax (Axes) – The axes containing the plot.

Example

xlims = [-18.5, -15] ylims = [-18.5, -15] f,ax = density_scatter(np.log10(X), np.log10(Y), xlims=xlims, ylims=ylims) ax.plot(np.linspace(-20, -15), np.linspace(-20, -15), c=’k’) ax.set_xlim(xlims) ax.set_ylim(ylims)