【发布时间】:2020-03-06 13:30:00
【问题描述】:
【问题讨论】:
【问题讨论】:
我找到了答案:
a = sns.jointplot(x=var_x, y=var_y, data=my_df)
a.ax_joint.plot([0],[0],'o',ms=60 , mec='r', mfc='none')
【讨论】:
ms 是 marker size。mec 是 marker edge color。mfc 是 @987654324 @.你可以在here看到所有其他kwargs的描述
有一种肮脏的方法可以做到这一点:从方程式生成圆,然后绘制它。我确信有更复杂的解决方案,但我还想不通。这是通过修改sns.JointGrid的数据。
import seaborn as sns
import numpy as np
import matplotlib.pyplot as plt
sns.set(style="ticks")
R = 8 # radius
d = np.linspace(0,2*np.pi, 400) # some data to draw circle
def circle(d, r):
# x and y from the equation of a circle
return r*np.cos(d), r*np.sin(d)
rs = np.random.RandomState(11)
x = rs.gamma(2, size=1000)
y = -.5 * x + rs.normal(size=1000)
#graph your data
graph = sns.jointplot(x, y, kind="hex", color="#4CB391")
# creating the circle
a, b = circle(d, R)
#graphing it
graph.x = a
graph.y = b
graph.plot_joint(plt.plot)
plt.show()
【讨论】: