Skip to content

Instantly share code, notes, and snippets.

@fcunhaneto
Last active September 5, 2018 11:52
Show Gist options
  • Save fcunhaneto/b6a6c55072c7b4bf431750a5179c86e2 to your computer and use it in GitHub Desktop.
Save fcunhaneto/b6a6c55072c7b4bf431750a5179c86e2 to your computer and use it in GitHub Desktop.
Inserindo titulo e legendas.
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