Scatter plots of two columns

plot_utils.scatter_plot_two_cols(X, two_columns, fig=None, ax=None, figsize=(3, 3), dpi=100, alpha=0.5, color=None, grid_on=True, logx=False, logy=False)[source]

Produce scatter plots of two of the columns in X (the data matrix). The correlation between the two columns are shown on top of the plot.

Parameters:
  • X (pandas.DataFrame) – The dataset. Currently only supports pandas dataframe.

  • two_columns ([str, str] or [int, int]) – The names or indices of the two columns within X. Must be a list of length 2. The elements must either be both integers, or both strings.

  • fig (matplotlib.figure.Figure or None) – Figure object. If None, a new figure will be created.

  • ax (matplotlib.axes._subplots.AxesSubplot or None) – Axes object. If None, a new axes will be created.

  • figsize ((float, float)) – Figure size in inches, as a tuple of two numbers. The figure size of fig (if not None) will override this parameter.

  • dpi (float) – Figure resolution. The dpi of fig (if not None) will override this parameter.

  • alpha (float) – Opacity of the scatter points.

  • color (str, list<float>, tuple<float>, or None) – Color of the scatter points. If None, default matplotlib color palette will be used.

  • grid_on (bool) – Whether or not to show grids on the plot.

Returns:

  • fig (matplotlib.figure.Figure) – The figure object being created or being passed into this function.

  • ax (matplotlib.axes._subplots.AxesSubplot) – The axes object being created or being passed into this function.