Skip to content

Instantly share code, notes, and snippets.

@fcunhaneto
Last active September 5, 2018 11:50
Show Gist options
  • Save fcunhaneto/c55751c11c8e9c39af72e2ff137f6e2d to your computer and use it in GitHub Desktop.
Save fcunhaneto/c55751c11c8e9c39af72e2ff137f6e2d to your computer and use it in GitHub Desktop.
Matplot reta simples com labels
import numpy as np
import matplotlib.pyplot as plt
"""
Acrescentando Grid
"""
arr1 = np.array([1, 2, 3, 4, 5, 6, 7 ,8, 9, 10])
arr2 = np.array([2, 4, 6, 8, 10, 12, 14 ,16, 18, 20])
plt.figure(figsize=(6, 4))
plt.plot(arr1, arr2)
plt.xlabel('x')
plt.ylabel('f(x) = x + 3')
plt.grid(True)
plt.savefig('reta-simples-labels.png')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment