我想为图例的两行画一个大括号,像这样:
我可以用 pyplot 创建除大括号之外的所有东西
plt.plot([],[],"ro",label="a")
plt.plot([],[],"bo",label="b")
plt.legend(frameon=False,loc="upper left")
plt.annotate("some property",
xy=(0.31, 0.7), xycoords='figure fraction',
xytext=(0.31, 0.79), textcoords='figure fraction',
arrowprops=dict(arrowstyle="-",lw=0
)
)
plt.plot()
如有任何帮助,我们将不胜感激。
最佳答案
感谢 ImportanceOfBeingErnest 的评论,我意识到简单地添加另一个注释的明显解决方案:
plt.annotate(r"$\}$",fontsize=24,
xy=(0.27, 0.77), xycoords='figure fraction'
)
关于python - 在 matplotlib 图例中的两条线上画一个大括号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48770052/