#Drawing the scale line
import matplotlib.pyplot as plt
import matplotlib
#Set figure
fig = plt.figure()
#Japanese setting
font = {'family' : ' IPAexGothic'}
matplotlib.rc('font', **font)
#Add Axes
ax = fig.add_subplot(111)
#Axis display settings
plt.xlabel("frequency")
plt.ylabel("Voltage")
#Set the axis range
ax.set_xlim(0.1, 1000)
ax.set_ylim(0, 1.04)
#x value y value setting
x = [0.1,0.2,0.4,0.7,1.0,2.0,4.0,7.0,10,20,40,70,100,200,400,700,1000]
y1 = [1, 1, 1, 0.980, 0.980, 0.980, 0.960, 0.920, 0.840, 0.680, 0.420, 0.280, 0.2, 0.120, 0.1, 0.080, 0.072]
y2 = [0.060, 0.060, 0.080, 0.100, 0.100, 0.180, 0.300, 0.460, 0.580, 0.800, 0.940, 0.980, 1.0, 1.02, 1.02, 1.02, 1.02]
plt.scatter(x, y1, s=30, c="r",label = "Whole")
plt.scatter(x, y2, s=30, c="b", label = "This this this",marker = "s")
#Semi-log graph settings
ax.set_xscale('log')
#Formatting the graph
plt.plot(x, y1, linestyle = "None", linewidth = 0)
#Set auxiliary scale line on x-axis
ax.grid(which = "major", axis = "x", color = "black", alpha = 0.8,linestyle = "--", linewidth = 1)
#Set scale line on y-axis
ax.grid(which = "major", axis = "y", color = "black", alpha = 0.8,linestyle = "--", linewidth = 1)
plt.legend(loc='center right', borderaxespad=1)
plt.show()
#Drawing the scale line
import matplotlib.pyplot as plt
import matplotlib
#Set figure
fig = plt.figure()
#Japanese setting
font = {'family' : ' IPAexGothic'}
matplotlib.rc('font', **font)
#Add Axes
ax = fig.add_subplot(111)
#Axis display settings
plt.xlabel("Voltage")
plt.ylabel("Current")
#Set the axis range
ax.set_xlim(0,10.1)
ax.set_ylim(0, 4.3 )
#x value y value setting
x = [0,1,2,3,4,5,6,7,8,9,10]
y1 = [0,0.18, 0.35, 0.53, 0.71, 0.89, 1.07, 1.25, 1.43, 1.61, 1.78]
y2 = [0, 0.41, 0.83, 1.25, 1.67, 2.09, 2.51, 2.93, 3.35, 3.77, 4.19]
plt.scatter(x, y1, s=30, c="r",label = "Whole")
plt.scatter(x, y2, s=30, c="b", label = "This this this",marker = "s")
#Formatting the graph
#plt.plot(x, y1, marker="o", color = "red", linestyle = "-")
plt.plot(x, y1, marker = "o", color = "red", linestyle = "-")
plt.plot(x,y2, marker = "o", color = "blue", linestyle = "-")
#Set auxiliary scale line on x-axis
ax.grid(which = "major", axis = "x", color = "black", alpha = 0.8,linestyle = "--", linewidth = 1)
#Set scale line on y-axis
ax.grid(which = "major", axis = "y", color = "black", alpha = 0.8,linestyle = "--", linewidth = 1)
plt.legend(loc='upper left', borderaxespad=1)
plt.show()
#Drawing the scale line
import matplotlib.pyplot as plt
import matplotlib
#Set figure
fig = plt.figure()
#Japanese setting
font = {'family' : ' IPAexGothic'}
matplotlib.rc('font', **font)
#Add Axes
ax = fig.add_subplot(111)
#Axis display settings
plt.xlabel("Voltage")
plt.ylabel("Current")
plt.title("The title is here.")
#Set the axis range
#ax.set_xlim(0, 1.0)
#ax.set_ylim(0, 30)
#x value y value setting
x = [0,0.1,0.2,0.3,0.4,0.5,0.60,0.65,0.68,0.7,0.72,0.74,0.75,0.76,0.78,0.8]
y1 = [0,0,0,0,0,0,0.02,0.10,0.28,0.54,1.42,3.21,4.7,4.98,10.87,30.15]
len_x = len(x)
print(len_x)
len_y1 = len(y1)
print(len_y1)
#Formatting the graph
plt.plot(x, y1, marker="o", color = "red", linestyle = "-")
#Set auxiliary scale line on x-axis
ax.grid(which = "major", axis = "x", color = "blue", alpha = 0.8,
linestyle = "--", linewidth = 1)
#Set scale line on y-axis
ax.grid(which = "major", axis = "y", color = "green", alpha = 0.8,
linestyle = "--", linewidth = 1)
plt.show()
The following sites will be helpful. Computational physicist research memorandum http://keisanbutsuriya.hateblo.jp/entry/2015/12/24/172953
reference https://techacademy.jp/magazine/19316 https://qiita.com/sci_Haru/items/68bd9a05d99598d445b0 https://paper.hatenadiary.jp/entry/2017/05/02/152223
Thank you for reading to the end.
Recommended Posts