Last active
September 5, 2018 11:52
-
-
Save fcunhaneto/93bba84d2dd234eb18e5c85b515fd24f to your computer and use it in GitHub Desktop.
Matplot inserindo titulo e legenda nos gráficos.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib.pyplot as plt | |
""" | |
Inserindo titulo e legendas | |
""" | |
x = np.arange(1, 11) | |
print(x) | |
plt.figure(figsize=(6, 4)) | |
plt.plot(x, 2*x, color='#17a589', label='f(x) = 2x') # green | |
plt.plot(x, x/2, color='red', label='f(x) = x/2') | |
plt.plot(x, x+3, color='#f4d03f', label='f(x) = x + 3') # yellow | |
plt.grid(True) | |
plt.title('Retas Simples') | |
plt.legend() | |
plt.savefig('reta-titulo-legendas.png') | |
plt.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment