我用两个 y 轴和两个数据集绘制了一个直方图,但我无法将两个 y 轴的比例设置为相同的限制。
在这个例子中http://matplotlib.org/examples/api/two_scales.html#api-two-scales这个想法是让两个尺度都在 0 到 25.000 之间。
有人对这个案例有想法吗?
最佳答案
你有没有试过这样的事情:
...
ax2 = ax1.twiny()
a,b = 0,25000
ax1.set_ylim(a,b)
ax2.set_ylim(a,b)
关于python - 两个相同比例的y轴,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15534898/