简体   繁体   中英

Figure text in matplotlib

I'm plotting quite simple with

plt.plot(a,b)
plt.grid()
plt.show()

But I need a figure text. I know I can use text(x, y, my_text) but I don't always know which combinations of x and y are visible in the plot due to different plot values.

Can I instead place the text below the plot? I guess it's something like

fig = plt.figure()
fig.text(0,0,my_text)
fig.plot(a,b)

(x, y) combination follow the next rules for figure coordinate system:

  • (0, 0) is bottom left of the figure.
  • (1, 1) is top right of the figure.

This is independent of the plot. You also can use axes coordinate and user data coordinate ( Transformations tutorial ).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM