Matplotlib Basics

import matplotlib.pyplot as plt

x = [1,2,3,4,5,6,7]
y = [50,51,52,48,47,49,46]

plt.xlabel("Day")

Text(0.5, 0, 'Day')

plt.ylabel("Temperature")

Text(0, 0.5, 'Temperature')

plt.title("Weather")

Text(0.5, 1.0, 'Weather')

plt.plot(x,y)

[<matplotlib.lines.Line2D at 0x21da2bd7b50>]

plt.plot(x,y, color='red', linewidth = 2)

[<matplotlib.lines.Line2D at 0x21da5217df0>]

plt.plot(x,y, color='red', linewidth=2, linestyle='dotted')

[<matplotlib.lines.Line2D at 0x21da4f6f6a0>]

plt.plot(x,y, color='green', linewidth=5, linestyle='dashed')

[<matplotlib.lines.Line2D at 0x21da4e686d0>]

plt.xlabel("Day")
plt.ylabel('Temperature')
plt.title('Weather')
plt.plot(x,y, color='green', linewidth=5, linestyle='dashed')

[<matplotlib.lines.Line2D at 0x21da4fd9be0>]

format strings

plt.xlabel("Day")
plt.ylabel('Temperature')
plt.title('Weather')
plt.plot(x,y, 'r+--')

[<matplotlib.lines.Line2D at 0x21da5052a60>]