python画直线
#!/usr/bin/env python import matplotlib.pyplot as plt import numpy as np #beita = 1 #gama = 0.5 #x:from 0 to 8 x = np.linspace(0, 8, 10) y = 2*x #xx = x*9.8*0.6 #OH = (0.33/(1-0.33)+beita)*(14.12-0.73*4.68)+0.73*4.68 #Oh = (0.33/(1-0.33)+gama)*(14.12-0.73*4.68)+0.73*4.68 #Or = 0.946*xx+0.25272 #Osita = 3*OH-Oh-xx*0.683552239-1.481 #Oz = 12.639+0.66*(OH-Oh)+0.316447761*xx plt.figure(figsize=(8, 8)) plt.plot(x, y, color="red") #plt.plot(x, Osita, color="blue") #plt.plot(x, Oz, color="green") #plt.xlabel(u'\u03c1'+" (g/cm^3)", fontproperties='SimHei', fontsize=18) #plt.ylabel(u'\u03c3'+" (Mpa)", fontproperties='SimHei', fontsize=18) plt.show()