plot_joint_kde#

agabpylib.plotting.distributions.plot_joint_kde(xdata, ydata, xname=None, yname=None, xunit=None, yunit=None, xlims=None, ylims=None, nx=100, ny=100, lnpmin=-5, contour_only=False, show_data=False)#

Plot the joint distribution of two variables, X and Y, for which the data set {(x_i, y_i)} is available.

The joint distribution are estimated using Kernel Density Estimation (KDE). The plot is produced using the currently active Axes object.

Parameters:
  • xdata (array_like) – 1D array of values of x_i

  • ydata (array_like) – 1D array of values of y_i

  • xname (str) – Name of the X variable

  • yname (str) – Name of Y variable

  • xunit (str) – Units for the X variable

  • yunit (str) – Units for the Y variable

  • xlims (tuple) – Tuple with limits in x to use (min, max)

  • ylims (tuple) – Tuple with limits in y to use (min, max)

  • nx (int) – Number of KDE samples in X

  • ny (int) – Number of KDE samples in Y

  • lnpmin (float) – minimum value of the log of the KDE density (relative to maximum) to include in colour image

  • contour_only (bool) – If true plot only the contours enclosing constant levels of cumulative probability

  • show_data (bool) – If true plot the data points

Returns:

ax – Axes object with the plot.

Return type:

matplotlib.axes.Axes