Skip to content

Instantly share code, notes, and snippets.

@fcunhaneto
Last active September 5, 2018 11:52
Show Gist options
  • Save fcunhaneto/4d2db55984b0c2c083b07e78d13e0861 to your computer and use it in GitHub Desktop.
Save fcunhaneto/4d2db55984b0c2c083b07e78d13e0861 to your computer and use it in GitHub Desktop.
Criando e colorindo retas com Matplot.
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