【问题标题】:Place title of subplot left of subplot row [duplicate]在子图行左侧放置子图的标题[重复]
【发布时间】:2018-11-27 03:31:00
【问题描述】:

当放置在 x*2 个子图的网格中时,是否可以将子图的标题放在图的左侧?这些图共享 x 轴,并以 2×2 的方式放置,因为它们表示两个方向的道路交通量。布局思路:

按照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')

【问题讨论】:

    标签: python-3.x matplotlib


    【解决方案1】:

    似乎没有直接的方法可以做到这一点。我相信你最好的选择是plt.text()

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-12-03
      • 1970-01-01
      • 2021-03-01
      • 1970-01-01
      相关资源
      最近更新 更多