首页 > 解决方案 > 如何使用 Matplotlib 在 Python 中沿无花果添加扩展箭头

问题描述

我正在使用 Matplotlib 绘制带有 4 个水平平行子图的无花果。无花果已成功绘制为:

在此处输入图像描述

我想添加一个表示扩展的双向箭头。具体来说,我想添加一个这样的箭头:

在此处输入图像描述

我使用以下代码绘制原始图:

fig = plt.figure(figsize = (12,4))
ax1 = fig.add_subplot(141)
PlotDimension(ax1, OCCdf, 'gender')
ax2 = fig.add_subplot(142)
PlotDimension(ax2, OCCdf, 'race')
ax3 = fig.add_subplot(143)
PlotDimension(ax3, OCCdf, 'class')
plt.show()

标签: pythonmatplotlib

解决方案


推荐阅读