scatter#
- caf.viz.xy_plot.scatter(fig, ax, data, *, density=False, cmap=None, colorbar=True, **kwargs)[source]#
Add scatter plot to given ax, with optional density colormap.
- Parameters:
fig (figure.Figure) – Figure containing plot Axes.
ax (axes.Axes) – Axes to add scatter plot to.
data (BasicData) – DataFrame and columns containing data to be plotted.
density (bool, default False) – Color scatter plot points based on the desntity, uses gaussian_kde to estimate density.
cmap (CmapData, optional) – Data for colouring scatter plot points, cannot be used if density is True.
colorbar (bool, default True) – If True and density is True add colour bar to fig.
kwargs (Keyword arguments) – Additional keyword arguments to pass to ax.scatter, ‘c’ parameter will be ignored if density or cmap are used.
- Raises:
ValueError – If cmap is given and density is True.
- Return type:
None
See also
axes.Axes.scatterbase matplotlib method for creating scatter plots.