我正在使用seaborn jointplot进行散点绘制,但我似乎找不到一条简单的对角线穿过。。。我得到一个AttributeError: 'JointGrid' object has no attribute 'get_xlim'
。有人知道使用Seaborn的解决方法吗?
这是我的代码(标题也没有出现!所给予的):
ax = sns.jointplot(x="Av Tomato-meter", y="Av Audience Score", data=director_combined_ratings, stat_func = None,
size = 8, xlim=(0,100), ylim=(0,100))
ax.plot(ax.get_xlim(), ax.get_ylim(), ls="--", c=".3") #this is the error line.
ax.title = "Average Tomato-meter vs Audience Score for Directors with over 10 Movies"
提前谢谢大家。
这个错误是一个有用的提示:JointPlot是子块的集合,您必须找到要绘制到的特定ax。修改Seaborn示例:
我在一个解释器中发现了这个问题:
dir(g)
,然后g.plot?
,g.plot_joint?
——这些是特定于jointplot的绘图函数——还有什么?--dir(g.ax_joint)
;啊哈,还有set_ylim
等等相关问题 更多 >
编程相关推荐