I'd like to color my histogram according to my palette. Here's the code I used to make this, and here's the error I received when I tried an answer I found on here.
g = sns.jointplot(data=emb_df, x='f0', y='y', kind="hist", hue='klabels', palette='tab10', marginal_kws={'hist_kws': {'palette': 'tab10'}})
plt.show()
UserWarning: The marginal plotting function has changed to `histplot`, which does not accept the following argument(s): hist_kws.
I have also tried this:
plt.setp(g.ax_marg_y.patches, color='grey')
But this does not color my histogram according my 'klabels' parameter, just a flat grey.


The marginal plot is colored by default using the same palette with corresponding hue. So, you could just run it without
marginal_kws=. Themarginal_kws=go directly to thehistplot; instead ofmarginal_kws={'hist_kws': {'palette': 'tab10'}}, the correct use would bemarginal_kws={'palette': 'tab10'}. If you would like stacked bars, you could trymarginal_kws={'multiple': 'stack'})If you want the marginal plots to be larger, the
ratio=parameter can be altered. The default is5, meaning the central plot is 5 times as large as the marginal plots.Here is an example:
To have these plots side-by-side as subplots, you can call the underlying
sns.histploteither with bothx=andy=filled in (2D histogram), onlyx=given (horizontal histogram) or onlyy=given (vertical histogram).