An example Analysis of drawing Graph with Python Matlab
Use Python Matlab to draw a graph of the example analysis, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain in detail for you, people with this need can come to learn, I hope you can gain something.
I. brief introduction
Here we use matplotlib in Python to draw the curve. Matplotlib is a famous python drawing library, which provides a complete set of drawing API, which is very suitable for interactive drawing.
Second, drawing graphics 1. The first graph
Code:
The specific drawing code is as follows:
Import matplotlib.pyplot as pltimport numpy as npr = np.array ([2072.54, 2076.84, 2085.51, 2103.01, 2129.93, 2162.16, 2200.22, 2242.15,2285.71,2328.29,2350.18,2364.01,2364.01,2343.29,2300.17,2252.25,2208.72,2166.85,2132.19,2103.01,2085.51,2075.77) 2072.54]) b = np.array ([30.159, 27.143, 24.127, 21.111, 18.096, 15.080, 12.064, 9.048,6.032,3.016,1.508,0,-1.508,3.016,6.032,9.048,12.064,15.080,18.096,21.111,24.127,27.143,18.096,21.111,24.127,27.143respectively). -30.159]) b = b _ * pow (10,-4) plt.plot (b, r) plt.xlabel ("Bhand T") plt.ylabel ("R / Ω") plt.title ("GMB Rmurb (decreasing B)") plt.show ()
Effect:
2. The second figure
Code:
The code is actually similar to the previous one:
Import matplotlib.pyplot as pltimport numpy as npr = np.array ([2072.53, 2076.81, 2085.47, 2103.00, 2129.90, 2162.11, 2200.20, 2242.06,2285.66,2328.24,2350.13,2364.00,2363.96,2343.19,2300.20,2252.29,2208.76,2166.89,2132.20,2103.05,2085.50,2075.81) 2072.56]) b = np.array ([30.159, 27.143, 24.127, 21.111, 18.096, 15.080, 12.064, 9.048,6.032,3.016,1.508,0,-1.508,3.016,6.032,9.048,12.064,15.080,18.096,21.111,24.127,27.143,18.096,21.111,24.127,27.143respectively). -30.159]) b = b _ * pow (10,-4) plt.plot (b, r) plt.xlabel ("Bhand T") plt.ylabel ("R / Ω") plt.title ("GMB Rmurb (increasing B)") plt.show ()
Effect:
3. The third figure
Code:
The code is basically the same:
Import matplotlib.pyplot as pltimport numpy as npv = np.array ([274,270,261,243,219,189,155,1185,81,48,34, 21]) b _ = np.array ([30.159, 27.143, 24.127, 21.111, 18.096, 15.080, 12.064, 9.048,6.032,3.016,1.508,0]) b = b* pow (10,-4) plt.plot (b) V) plt.xlabel ("GMB T") plt.ylabel ("V/mV") plt.title ("GMB Vmurb") plt.show ()
Effect:
4. The fourth figure
Code:
In fact, the code is basically the same, but mainly changed the data:
Import matplotlib.pyplot as pltimport numpy as npw = np.array ([43.5, 44, 47, 50, 53, 56, 59, 62, 65, 68, 71, 74, 77, 80, 83, 86, 89, 92, 95, 98, 101104]) v = np.array ([0,5.7,35.0,53.8,45.9,7.7,-45.7,51.9,-32.6,-1.8,34.5,53.1]) ) plt.plot (w, v) plt.xlabel ("θ / rad") plt.ylabel ("V/mV") plt.title ("GMB V-θ") plt.show ()
Effect:
5. Draw a polynomial function of the specified interval: import numpy as npimport matplotlib.pyplot as pltX = np.linspace (- 4, 4, 1024) Y = .25 * (X + 4.) * (X + 1.) * (X-2.) plt.title ('$f (x) =\\ frac {1} {4} (x = 4) (x = 2) $') plt.plot (X, Y, c ='g') plt.show ()
Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.