Заранее спасибо.
Код: Выделить всё
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
import matplotlib.path as mpath
fig, ax = plt.subplots()
Path = mpath.Path
path_data = [
(Path.MOVETO, (0, 0)),
(Path.CURVE4, (0, 1.0)),
(Path.CURVE4, (1, 1.0)),
(Path.CURVE4, (1, 1)),
(Path.LINETO, (4, 1)),
(Path.CURVE4, (4, 1)),
(Path.CURVE4, (5, 1.05)),
(Path.CURVE4, (5, 0)),
(Path.CLOSEPOLY, (0, 0)),
]
codes, verts = zip(*path_data)
path = mpath.Path(verts, codes)
patch = mpatches.PathPatch(path, facecolor='r', alpha=0.5)
ax.add_patch(patch)
x, y = zip(*path.vertices)
#line, = ax.plot(x, y, 'go-')
text_obj = plt.text(x = 0.75, y = 0.35, s = 'Text', fontsize = 32)
ax.grid()
ax.axis('equal')
plt.show()

Подробнее здесь: https://stackoverflow.com/questions/790 ... tside-axes