I would like to draw a curly bracket for two lines of the legend, like so:
I am able to create everything with pyplot except for the curly bracket using
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()
Any help would be greatly appreciated.
Thanks to the comment by ImportanceOfBeingErnest I realized the obvious solution of simply adding another annotation:
plt.annotate(r"$\}$",fontsize=24,
xy=(0.27, 0.77), xycoords='figure fraction'
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With