Jamgreen
Jamgreen

Reputation: 11039

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)

Upvotes: 0

Views: 767

Answers (1)

cosmoscalibur
cosmoscalibur

Reputation: 1173

(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).

Upvotes: 1

Related Questions