I am trying to plot some data with a probability scale (Y-axis) and log scale (X-axis). Here is the code that I am currently using:
import matplotlib.pyplot as plt
import probscale
x = [0.25,0.28,0.3,0.35,0.4,0.45,0.5,0.58,0.65,0.7,0.8,1,1.3,1.6,2,2.5,3]
y = [0,0.577629967,1.155259933,1.680378085,2.485559251,3.920882198,4.98862244,
10.13478033,18.32662349,23.15771048,33.81760896,47.43567303,70.13828111,
82.74111675,94.78382636,98.09207072,100]
fig, ax = plt.subplots(figsize=(8, 6))
ax.set_yscale('prob')
ax.set_ylim(bottom=0.1, top=99.9)
ax.set_ylabel('Cumulative mass(%)')
ax.set_xscale('log')
ax.set_xlim(left=0.2, right=3.5)
ax.set_xlabel('Diameter')
plt.scatter(x,y)
plt.show()
And the picture below shows what I got by the code.
I wonder how to add a linear fitting to the current plot. Thank you!
Jerry