In [2]:
import numpy as np import matplotlib.pyplot as plt import math 
In [3]:
def ls(x): if math.log10(x) < 0: log = -1 * math.log10(x) else: log = math.log(x) return log 
In [4]:
p_finer =[0, 6.8899, 9.4189, 11.57, 20.4362, 72.6745] logs = [0, ls(0.075), ls(0.15), ls(0.3), ls(0.6), ls(4.75)] Dx = [0.77,0.46, 1.23] Dy = [10, 30, 60] 
In [5]:
plt.figure(figsize=(15, 6)) plt.title('Particle Size distribution curve plot by Anand Prabhakar', fontsize=15) plt.scatter(logs, p_finer,c='r', s=20, cmap=plt.cm.rainbow) plt.scatter(Dx, Dy, c = 'g', s=80) plt.plot(logs, p_finer,c='b') plt.legend(['observed points', 'Dx points', 'curve'], loc='lower right') plt.annotate('D60 => 1.23', xy =(1.23, 60),xytext =(1,70),arrowprops = dict(facecolor ='r',shrink = 1)) plt.annotate('D30 => 0.46', xy =(0.46, 30),xytext =(0.6,20), arrowprops = dict(facecolor ='y')) plt.annotate('D10 => 0.77', xy =(0.77, 10),xytext =(0.8,20), arrowprops = dict(facecolor ='r')) plt.xlabel("log10(n); (where n = sieve size))",fontsize=12) plt.ylabel("% finer",fontsize=12) plt.hlines([10], 0,0.77, colors='y') plt.hlines([30], 0,0.46, colors='y') plt.hlines([60], 0,1.23, colors='y') plt.vlines([0.77], 0,10, colors='r') plt.vlines([0.46], 0,30, colors='r') plt.vlines([1.23], 0,60, colors='r') plt.show()