# -*- coding: utf-8 -*- import numpy as np import pandas as pd import matplotlib.pyplot as plt x = np.arange(5,25) y = pd.Series(np.random.randint(5,45,20)) plt.figure(figsize=(8,6)) # set the size before other settings plt.title("August", fontsize = 30, color='blue', fontname='castellar', pad = 10, horizontalalignment = 'center', loc='center') plt.xlabel('Day', color='g', fontsize = 15) plt.ylabel('Temperature', color='c', fontsize = 15, fontname = 'Times New Roman') plt.axis([0 ,30, 0, 50]) plt.grid(True, color='olive') plt.tick_params(axis='y', labelcolor='r', width = 5) for i in range(len(x)): plt.text(x[i]+0.5, y[i]+0.5, y[i], color='green', withdash=True) plt.minorticks_on() plt.plot(x,y,'bo:', mfc = 'red', mec='red') plt.legend(['oC'] ,loc=0)