title: Scatterplot with marginal KDE plots and multiple categories in Matplotlib
body: <p>I'd like a function in Matplotlib similar to the <a href="https://uk.mathworks.com/help/stats/scatterhist.html" rel="noreferrer">Matlab 'scatterhist' function</a> which takes continuous values for 'x' and 'y' axes, plus a categorical variable as input; and produces a scatter plot with marginal KDE plots and two or more categorical variables in different colours as output: <a href="https://i.stack.imgur.com/M1B62.png" rel="noreferrer"><img src="https://i.stack.imgur.com/M1B62.png" alt="Matlab / Mathworks &#39;scatterhist&#39; example"></a>
  I've found examples of scatter plots with <a href="https://matplotlib.org/examples/pylab_examples/scatter_hist.html" rel="noreferrer">marginal histograms in Matplotlib</a>, <a href="https://stackoverflow.com/questions/37008112/matplotlib-plotting-histogram-plot-just-above-scatter-plot">marginal histograms in Seaborn jointplot</a>, <a href="https://stackoverflow.com/questions/49268558/matplotlib-unreadable-scatter-plots-and-histograms-on-shared-axis-with-logscale">overlapping histograms in Matplotlib</a> and <a href="https://stackoverflow.com/questions/20525983/matplotlib-imshow-a-2d-array-with-plots-of-its-marginal-densities">marginal KDE plots in Matplotib</a> ; but I haven't found any examples which combine scatter plots with marginal KDE plots and are colour coded to indicate different categories. </p>
  
  <p>If possible, I'd like a solution which uses 'vanilla' Matplotlib without Seaborn, as this will avoid dependencies and allow complete control and customisation of the plot appearance using standard Matplotlib commands.</p>
  
  <p>I was going to try to write something based on the above examples; but before doing so wanted to check whether a similar function was already available, and if not then would be grateful for any guidance on the best approach to use.</p>