import pandas as pd
from pandas import Series
import matplotlib.pyplot as plt
temperature = pd.read_csv(
"https://milliams.com/courses/data_analysis_python/cetml1659on.txt", # file name
skiprows=6, # skip header
delim_whitespace=True, # whitespace separated
na_values=['-99.9', '-99.99'], # NaNs
)
Taking the colours from the matplotlib docs:
year_plot = temperature['JAN'].plot(color="steelblue")
year_plot = temperature['JUN'].plot(color="firebrick")
year_plot.set_xlabel(r'Year')
year_plot.set_ylabel(r'Temperature ($^\circ$C)')
plt.show()
And taking the line style from the docs again:
year_plot = temperature['JAN'].plot(color="steelblue")
year_plot = temperature['JUN'].plot(color="firebrick")
year_plot = temperature['YEAR'].plot(color="green", linestyle="--")
year_plot.set_xlabel(r'Year')
year_plot.set_ylabel(r'Temperature ($^\circ$C)')
plt.show()