Last active
September 5, 2018 11:52
-
-
Save fcunhaneto/4d2db55984b0c2c083b07e78d13e0861 to your computer and use it in GitHub Desktop.
Criando e colorindo retas com Matplot.
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 | |
""" | |
Escolhendo cores para as retas | |
""" | |
x = np.arange(1, 11) | |
print(x) | |
plt.figure(figsize=(6, 4)) | |
plt.plot(x, 2*x, color='#17a589') # green | |
plt.plot(x, x/2, color='red') | |
plt.plot(x, x+3, color='#f4d03f') # yellow | |
plt.xlabel('x') | |
plt.ylabel('f(x)') | |
plt.grid(True) | |
plt.savefig('reta-simples-cores.png') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment