Matplotlib/Seaborn double scatter plot with three side histograms (extending JointGrid) -
i have 3 datasets (data1, data2, data3), , i'd create rather complicated plot: stacked scatter plot (two scatter plots on top of each other) 3 histograms on sides.
this have far 1 set, , below can see resulting plot:
from numpy.random import randn import matplotlib mpl import matplotlib.pyplot plt import seaborn sns data1 = randn(500) data2 = randn(500) * 20 data3 = randn(500) + 5 e1c = sns.color_palette()[0] e2c = sns.color_palette()[1] e3c = sns.color_palette()[2] sns.axes_style("white"): g = sns.jointgrid(data2, data3) g.plot_marginals(sns.distplot, kde=false, color=e3c) g.plot_joint(plt.scatter, color=e3c, alpha=.2) plt.show()
and same 1 annotations need produce:
to make more complicated, left , right y axes (data1 , data 3) have different range of values.
so summarise, here list of things need include:
- another scatter plot (data2, data1) in color e1c
- data1 has have histogram on left, in color e1c
- all histograms should have finer bins (say, 5x more bins).
- histogram on top (data2) should in color e2c.
- there should 2 y axis (one data1, data3).
- there should labels on each axis ("data 1", ...).
how accomplish this?
Comments
Post a Comment