import matplotlib.pyplot as plt import numpy as np x = np.linspace(0, 10, 100) y = x**2 #Left-hand estimate rect_x = np.linspace(0, 10, 11) rect_y = rect_x**2 rect_height = rect_y[:-1] rect_width = rect_x[1:] - rect_x[:-1] #Right-hand estimate rect_x_r = np.linspace(-1, 9, 11) rect_y_r = (rect_x_r+1)**2 rect_height_r = rect_y_r[1:] rect_width_r = rect_x_r[1:] - rect_x_r[:-1] plt.bar(rect_x_r[1:], rect_height_r, rect_width_r, align='edge', alpha=0.5, color='orange', label='Right-hand estimate') plt.bar(rect_x[:-1], rect_height, rect_width, align='edge', alpha=0.5, color='blue', label='Left-hand estimate') plt.plot(x, y, label='y = x^2') plt.xlabel('x') plt.ylabel('y') plt.title('y = x^2 and Left/Right-hand estimate') plt.legend() plt.grid() plt.show()
氦的發現與回收 氦是 1868 年天文學家觀測日食時的太陽光譜線時,意外發現的新元素,以太陽神 Helios 命名為 Helium ,也能突顯氦元素發現的曲折歷史。 氦元素質量比大氣主要氣體分子氮和氧輕很多,只要從石油或岩層溢出,就能輕易的飄到地球大氣層上方。雖然只有少數地表...