摘要:
1 import matplotlib.pyplot as plt 2 3 fig = plt.figure() 4 x = [1, 2, 3, 4, 5, 6, 7] 5 y = [1, 3, 4, 2, 5, 8, 6] 6 7 # below are all percentage 8 left, bottom, width, height = 0.1, 0.1, 0.8... 阅读全文
摘要:
1 import matplotlib.pyplot as plt 2 3 # example 1: 4 ############################### 5 plt.figure(figsize=(6, 4)) 6 # plt.subplot(n_rows, n_cols, plot_num) 7 plt.subplot(2, 2, 1) 8 plt.plot(... 阅读全文
摘要:
1 import matplotlib.pyplot as plt 2 import numpy as np 3 4 #定义计算高度的函数 5 def f(x,y): 6 return (1 - x/2 + x**5 +y**3) * np.exp(-x**2 - y**2) 7 8 n = 256 9 x = np.linspace(-3, 3, n) 10 y ... 阅读全文
摘要:
1 import matplotlib.pyplot as plt 2 import numpy as np 3 4 x = np.linspace(-3, 3, 50) 5 y1 = 2 * x + 1 6 7 #figure 1 8 plt.figure() 9 plt.plot(x, y1, linewidth = 10,zorder=1) 10 11 12 #横... 阅读全文