results show:

 import complete code example: numpy as NP import matplotlib.pyplot as PLT fig, ax = plt.subplots (figsize= (5, 5) ax.set_aspect) (1) X1 = -1 + np.random.randn = -1 + Y1 (100) np.random.randn (100) x2 = 1. + np.random.randn (100) y2 = 1. + np.random.randn (100) ax.scatter (x1, Y1, color=, R) ax.scatter (X2, Y2, color= "g" bbox_props (boxstyle=) = dict "round fc=", "W", "ec= 0.5"), alpha=0.9 ax.text (-2, -2, "Sample A ha=", "center", "center" va=, size=20, bbox=bbox_props) ax.text (2, 2, Sa Mple B "ha=" center "va=," "center, size=20, bbox=bbox_props) bbox_props = dict (boxstyle= rarrow, fc= (0.8, 0.9, 0.9), ec= B, lw=2) t = ax.text (0, 0," Direction "," ha= "center, va=" center "rotation=45, size=15, bbox=bbox_props, BB) = (t.get_bbox_patch) bb.set_boxstyle (rarrow, pad=0.6) ax.set_xlim (-4, 4) ax.set_ylim (-4, 4) plt.show (

)

< /span>

" summing up the above article is all about Python Matplotlib text annotation arrow simple code example, hope to help. Interested friends can continue to refer to the "matplotlib

" animation example code "

python+matplotlib drawing simple dolphin (vertex and node operation)

" Python painted by Matplotlib double pie and ring figure

simple example" ifinadequate, pointed out the welcome message. Thank you for the support of our friends!


This concludes the body part