将子图标题放置在子图行的左侧

5
在一个x*2的子图网格中,当子图共享x轴并以两个为一组时,是否可以将子图的标题放置在图形左侧?这些图形代表双向道路的交通计数。布局的想法如下图所示:enter image description here 子图的排列方式如此处所示:这里
import matplotlib.pyplot as plt
import numpy as np

# Simple data to display in various forms
x = np.linspace(0, 2 * np.pi, 400)
y = np.sin(x ** 2)

# row and column sharing
f, ((ax1, ax2), (ax3, ax4)) = plt.subplots(2, 2, sharex='col', sharey='row')
ax1.plot(x, y)
ax1.set_title('Sharing x per column, y per row')
ax2.scatter(x, y)
ax3.scatter(x, 2 * y ** 2 - 1, color='r')
ax4.plot(x, 2 * y ** 2 - 1, color='r')
1个回答

0

似乎没有直接的方法来完成这个操作,我认为最好的方式是使用plt.text()函数。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接