Add data to maritime connection

I have a good KDE sharing plot using the following marine method (where return and volatility are float lists):

data=pd.DataFrame({"return":returns,"volatility":volatilities,}) a=sns.jointplot(x="volatility", y="return", data=data, size=10) 

How can I put certain points on this general plot? For example, if I wanted the red dot to overlap the KDE chat in (0.2, 0.2)

+5
source share
1 answer

You can build on the axis of the joint with jointplot as follows:

 a=sns.jointplot(x="volatility", y="return", data=data, size=10) a.ax_joint.plot([0.2],[0.2],'ro') 

As an aside, you can also access the x and y subtitles with

 a.ax_marg_x a.ax_marg_y 
+8
source

Source: https://habr.com/ru/post/1235291/


All Articles