如何在seaborn联合图中显示边缘直方图的垂直比例? [英] How to show the vertical scale of marginal histogram in seaborn jointplot?
问题描述
在Seaborn关节图中,边缘直方图未显示y轴值.我怎样才能得到这些值?该文档没有显示任何更改此行为的参数.
In Seaborn jointplot, the marginal histograms do not show the y axis values. How can I get these values? The documentation doesn't show any arguments to change this behavior.
推荐答案
您将不得不在 matplotlib 方面做更多工作.如果只想获取轴的限制,则可以使用 get_ylim
.这些直方图的句柄是 ax_marg_x
和 ax_marg_y
.
You're going to have to work more on the matplotlib side of things. If you just want to get the limits of the axis, you can use get_ylim
. The handle for those histograms are ax_marg_x
and ax_marg_y
.
g = sns.jointplot(...)
g.ax_marg_x.get_ylim()
您还可以在刻度标签上使用 set_visible
使刻度标签可见:
You can also make the tick labels visible using set_visible
on the tick labels:
for tick in g.ax_marg_x.get_yticklabels():
tick.set_visible(True)
您还可以使用 set_yticklabels
创建自己的刻度标签.
You can also create your own tick labels with set_yticklabels
.
这篇关于如何在seaborn联合图中显示边缘直方图的垂直比例?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!