class_docstr: Joint plots are useful for machine learning on multi-dimensional data, allowing for
  the visualization of complex interactions between different data dimensions, their
  varying distributions, and even their relationships to the target variable for
  prediction.
  
  The Yellowbrick ``JointPlot`` can be used both for pairwise feature analysis and
  feature-to-target plots. For pairwise feature analysis, the ``columns`` argument can
  be used to specify the index of the two desired columns in ``X``. If ``y`` is also
  specified, the plot can be colored with a heatmap or by class. For feature-to-target
  plots, the user can provide either ``X`` and ``y`` as 1D vectors, or a ``columns``
  argument with an index to a single feature in ``X`` to be plotted against ``y``.
  
  Histograms can be included by setting the ``hist`` argument to ``True`` for a
  frequency distribution, or to ``"density"`` for a probability density function. Note
  that histograms requires matplotlib 2.0.2 or greater.
  
  Parameters
  ----------
  ax : matplotlib Axes, default: None
      The axes to plot the figure on. If None is passed in the current axes will be
      used (or generated if required). This is considered the base axes where the
      the primary joint plot is drawn. It will be shifted and two additional axes
      added above (xhax) and to the right (yhax) if hist=True.
  
  columns : int, str, [int, int], [str, str], default: None
      Determines what data is plotted in the joint plot and acts as a selection index
      into the data passed to ``fit(X, y)``. This data therefore must be indexable by
      the column type (e.g. an int for a numpy array or a string for a DataFrame).
  
      If None is specified then either both X and y must be 1D vectors and they will
      be plotted against each other or X must be a 2D array with only 2 columns. If a
      single index is specified then the data is indexed as ``X[columns]`` and plotted
      jointly with the target variable, y. If two indices are specified then they are
      both selected from X, additionally in this case, if y is specified, then it is
      used to plot the color of points.
  
      Note that these names are also used as the x and y axes labels if they aren't
      specified in the joint_kws argument.
  
  correlation : str, default: 'pearson'
      The algorithm used to compute the relationship between the variables in the
      joint plot, one of: 'pearson', 'covariance', 'spearman', 'kendalltau'.
  
  kind : str in {'scatter', 'hex'}, default: 'scatter'
      The type of plot to render in the joint axes. Note that when kind='hex' the
      target cannot be plotted by color.
  
  hist : {True, False, None, 'density', 'frequency'}, default: True
      Draw histograms showing the distribution of the variables plotted jointly.
      If set to 'density', the probability density function will be plotted.
      If set to True or 'frequency' then the frequency will be plotted.
      Requires Matplotlib >= 2.0.2.
  
  alpha : float, default: 0.65
      Specify a transparency where 1 is completely opaque and 0 is completely
      transparent. This property makes densely clustered points more visible.
  
  {joint, hist}_kws : dict, default: None
      Additional keyword arguments for the plot components.
  
  kwargs : dict
      Keyword arguments that are passed to the base class and may influence
      the visualization as defined in other Visualizers.
  
  Attributes
  ----------
  corr_ : float
      The correlation or relationship of the data in the joint plot, specified by the
      correlation algorithm.
  
  Examples
  --------
  
  >>> viz = JointPlot(columns=["temp", "humidity"])
  >>> viz.fit(X, y)
  >>> viz.show()
class_docstr_tok: ["Joint","plots","are","useful","for","machine","learning","on","multi-dimensional","data",",","allowing","for","the","visualization","of","complex","interactions","between","different","data","dimensions",",","their","varying","distributions",",","and","even","their","relationships","to","the","target","variable","for","prediction",".","The","Yellowbrick","``","JointPlot","``","can","be","used","both","for","pairwise","feature","analysis","and","feature-to-target","plots",".","For","pairwise","feature","analysis",",","the","``","columns","``","argument","can","be","used","to","specify","the","index","of","the","two","desired","columns","in","``","X","``",".","If","``","y","``","is","also","specified",",","the","plot","can","be","colored","with","a","heatmap","or","by","class",".","For","feature-to-target","plots",",","the","user","can","provide","either","``","X","``","and","``","y","``","as","1D","vectors",",","or","a","``","columns","``","argument","with","an","index","to","a","single","feature","in","``","X","``","to","be","plotted","against","``","y","``",".","Histograms","can","be","included","by","setting","the","``","hist","``","argument","to","``","True","``","for","a","frequency","distribution",",","or","to","``","``","density","''","``","for","a","probability","density","function",".","Note","that","histograms","requires","matplotlib","2.0.2","or","greater",".","Parameters","--","--","--","--","--","ax",":","matplotlib","Axes",",","default",":","None","The","axes","to","plot","the","figure","on",".","If","None","is","passed","in","the","current","axes","will","be","used","(","or","generated","if","required",")",".","This","is","considered","the","base","axes","where","the","the","primary","joint","plot","is","drawn",".","It","will","be","shifted","and","two","additional","axes","added","above","(","xhax",")","and","to","the","right","(","yhax",")","if","hist=True",".","columns",":","int",",","str",",","[","int",",","int","]",",","[","str",",","str","]",",","default",":","None","Determines","what","data","is","plotted","in","the","joint","plot","and","acts","as","a","selection","index","into","the","data","passed","to","``","fit","(","X",",","y",")","``",".","This","data","therefore","must","be","indexable","by","the","column","type","(","e.g",".","an","int","for","a","numpy","array","or","a","string","for","a","DataFrame",")",".","If","None","is","specified","then","either","both","X","and","y","must","be","1D","vectors","and","they","will","be","plotted","against","each","other","or","X","must","be","a","2D","array","with","only","2","columns",".","If","a","single","index","is","specified","then","the","data","is","indexed","as","``","X","[","columns","]","``","and","plotted","jointly","with","the","target","variable",",","y",".","If","two","indices","are","specified","then","they","are","both","selected","from","X",",","additionally","in","this","case",",","if","y","is","specified",",","then","it","is","used","to","plot","the","color","of","points",".","Note","that","these","names","are","also","used","as","the","x","and","y","axes","labels","if","they","aren't","specified","in","the","joint_kws","argument",".","correlation",":","str",",","default",":","'pearson'","The","algorithm","used","to","compute","the","relationship","between","the","variables","in","the","joint","plot",",","one","of",":","'pearson","'",",","'covariance","'",",","'spearman","'",",","'kendalltau","'",".","kind",":","str","in","{","'scatter","'",",","'hex","'","}",",","default",":","'scatter'","The","type","of","plot","to","render","in","the","joint","axes",".","Note","that","when","kind='hex","'","the","target","can","not","be","plotted","by","color",".","hist",":","{","True",",","False",",","None",",","'density","'",",","'frequency","'","}",",","default",":","True","Draw","histograms","showing","the","distribution","of","the","variables","plotted","jointly",".","If","set","to","'density","'",",","the","probability","density","function","will","be","plotted",".","If","set","to","True","or","'frequency","'","then","the","frequency","will","be","plotted",".","Requires","Matplotlib",">","=","2.0.2.","alpha",":","float",",","default",":","0.65","Specify","a","transparency","where","1","is","completely","opaque","and","0","is","completely","transparent",".","This","property","makes","densely","clustered","points","more","visible",".","{","joint",",","hist","}","_kws",":","dict",",","default",":","None","Additional","keyword","arguments","for","the","plot","components",".","kwargs",":","dict","Keyword","arguments","that","are","passed","to","the","base","class","and","may","influence","the","visualization","as","defined","in","other","Visualizers",".","Attributes","--","--","--","--","--","corr_",":","float","The","correlation","or","relationship","of","the","data","in","the","joint","plot",",","specified","by","the","correlation","algorithm",".","Examples","--","--","--","--",">",">",">","viz","=","JointPlot","(","columns=","[","``","temp","''",",","``","humidity","''","]",")",">",">",">","viz.fit","(","X",",","y",")",">",">",">","viz.show","(",")"]
docstr: Draw the joint plot for the data in x and y.
  
  Parameters
  ----------
  x, y : 1D array-like
      The data to plot for the x axis and the y axis
  
  xlabel, ylabel : str
      The labels for the x and y axes.
docstr_tok: ["Draw","the","joint","plot","for","the","data","in","x","and","y.","Parameters","--","--","--","--","--","x",",","y",":","1D","array-like","The","data","to","plot","for","the","x","axis","and","the","y","axis","xlabel",",","ylabel",":","str","The","labels","for","the","x","and","y","axes","."]
code: def draw(self, x, y, xlabel=None, ylabel=None):
      """
      Draw the joint plot for the data in x and y.
  
      Parameters
      ----------
      x, y : 1D array-like
          The data to plot for the x axis and the y axis
  
      xlabel, ylabel : str
          The labels for the x and y axes.
      """
      # This is a little weird to be here, but it is the best place to perform
      # this computation given how fit calls draw and returns.
      self.corr_ = self.correlation_methods[self.correlation](x, y)
  
      # First draw the joint plot
      joint_kws = self.joint_kws or {}
      joint_kws.setdefault("alpha", self.alpha)
      joint_kws.setdefault(
          "label", "{}={:0.3f}".format(self.correlation, self.corr_)
      )
  
      # Draw scatter joint plot
      if self.kind == "scatter":
          self.ax.scatter(x, y, **joint_kws)
  
          # TODO: Draw best fit line (or should this be kind='reg'?)
  
      # Draw hexbin joint plot
      elif self.kind in ("hex", "hexbin"):
          joint_kws.setdefault("mincnt", 1)
          joint_kws.setdefault("gridsize", 50)
          joint_kws.setdefault("cmap", "Blues")
          self.ax.hexbin(x, y, **joint_kws)
  
      # Something bad happened
      else:
          raise ValueError(
              "unknown joint plot kind '{}'".format(self.kind)
          )
  
      # Set the X and Y axis labels on the plot
      self.ax.set_xlabel(xlabel)
      self.ax.set_ylabel(ylabel)
  
      # If we're not going to draw histograms, stop here
      if not self.hist:
          # Ensure the current axes is always the main joint plot axes
          plt.sca(self.ax)
          return self.ax
  
      # Draw the histograms
      hist_kws = self.hist_kws or {}
      hist_kws.setdefault("bins", 50)
      if self.hist == "density":
          hist_kws.setdefault("density", True)
  
      self.xhax.hist(x, **hist_kws)
      self.yhax.hist(y, orientation="horizontal", **hist_kws)
  
      # Ensure the current axes is always the main joint plot axes
      plt.sca(self.ax)
      return self.ax
  
file_path: yellowbrick/yellowbrick/features/jointplot.py
imports: import numpy
  import matplotlib.pyplot
  from .base import FeatureVisualizer
  from ..utils.types import is_dataframe
  from ..exceptions import YellowbrickValueError
  from scipy.stats import pearsonr, spearmanr, kendalltau
label_desc: Use image node_id 6 for calling the JointPlot obj's underlying member method code with example usage: obj.draw(x, y, xlabel, ylabel) and returns: self, self