“Adicione texto ao plot python” Respostas de código

Adicione texto ao plot python

import matplotlib.pyplot as plt
w = 4
h = 3
d = 70
plt.figure(figsize=(w, h), dpi=d)
x = [1, 2, 4]
x_pos = 0.5
y_pos = 3
plt.text(x_pos, y_pos, "text on plot")
plt.plot(x)
plt.savefig("out.png")Outputout.png
Ugliest Unicorn

Adicione texto para plotar a dispersão do python

y = [2.56422, 3.77284, 3.52623, 3.51468, 3.02199]
z = [0.15, 0.3, 0.45, 0.6, 0.75]
n = [58, 651, 393, 203, 123]

fig, ax = plt.subplots()
ax.scatter(z, y)

for i, txt in enumerate(n):
    ax.annotate(txt, (z[i], y[i]))
Perro Fiel

Respostas semelhantes a “Adicione texto ao plot python”

Perguntas semelhantes a “Adicione texto ao plot python”

Mais respostas relacionadas para “Adicione texto ao plot python” em Python

Procure respostas de código populares por idioma

Procurar outros idiomas de código