# Berendsen's code 2.5 for Fig.2.6 import matplotlib.pyplot as plt import numpy as np time = np.array([20., 40., 60., 80., 100., 120., 140., 160., 180]) conc = np.array([75., 43., 26., 16., 10., 5., 3.5, 1.8, 1.6]) err = np.array([4., 3., 3., 3., 2., 2., 1., 1., 1.]) fig, ax = plt.subplots() ax.plot(time,conc,lw=2,ls='-',marker='o',ms=5,mec='r',mew=2,mfc='r') ax.set_yscale('log') pos = [1, 10, 100] # ax.set_yticks(pos) # ticks = ['1', '10', '100'] # ax.set_yticklabels(ticks) # plt.semilogy(time, conc)') plt.errorbar(time, conc, err) plt.grid(axis='y', which='both') plt.grid(axis='x', which='major') font1 = {'family':'serif','color':'blue','size':13} plt.xlabel('time $t$/s',fontdict = font1 ) plt.ylabel('concentration $c$/mmol L$^{-1}$',fontdict = font1) plt.title('Code 2.5 for Fig.2.7') plt.show() # fig.savefig('plot of fig.2.7.png')