两个具有相同比例的 y 轴

Jac*_*ith 3 python matplotlib

我做了一个带有两个 y 轴和两个数据集的直方图,但我无法将两个 y 轴的比例设置为相同的限制。

在这个例子中http://matplotlib.org/examples/api/two_scales.html#api-two-scales的想法是让两个比例从 0 到 25.000。

有人对这个案子有什么想法吗?

ask*_*han 5

您是否尝试过类似的事情:

...
ax2 = ax1.twiny()
a,b = 0,25000
ax1.set_ylim(a,b)
ax2.set_ylim(a,b)
Run Code Online (Sandbox Code Playgroud)