Python:(使用matplotlib畫圖)次座標軸,兩個座標軸

    代碼如下 import matplotlib.pyplot as plt import numpy as np x = np.arange(0,10,0.1) y1 = 0.05 * x**2 y2 = -1 * y1 fig, ax1 = plt.subplots() ax2 = ax1.twinx() ax1.plot(x,y1,'g-') ax2.plot(x,y2,'b-')
相關文章
相關標籤/搜索