Getting Legends in the Sea Chest

I am interested in using a maritime compound plot to visualize the correlation between two numpy arrays. I like the visual difference that kind = 'hex' gives, but I would also like to know the actual amount that matches the different shades. Does anyone know how to put this legend on the side or even on the plot? I tried to look at the documentation and could not find it.

Thanks!

+8
python seaborn
source share
1 answer

You need to do this manually by creating a new axis using add_axes and then pass the ax name to plt.colorbar()

 import numpy as np import seaborn as sns x = np.random.normal(0.0,1.0,1000) y = np.random.normal(0.0,1.0,1000) hexplot = sns.jointplot(x, y, kind="hex") sns.plt.subplots_adjust(left=0.2, right=0.8, top=0.8, bottom=0.2) # shrink fig so cbar is visible cax = hexplot.fig.add_axes([.85, .25, .05, .4]) # x, y, width, height sns.plt.colorbar(cax=cax) 

Siberian hex box with color panel

Sources: I almost gave up after I read dev, let me know that

"the coefficient of work / benefit [for the implementation of color panels] is too high"

but then I found this solution in another problem .

+10
source share

All Articles