2018年1月22日 星期一

一張圖裡面有多張數據圖...

plt.subplot() 這個指令就是拿來畫多張圖用的指令

import matplotlib.pyplot as plt
import numpy as np

x1 = np.arange(0,360,1)
y1 = np.sin(x1 * np.pi / 180.0)

x2 = x1
y2 = np.cos(x2 * np.pi / 180.0)

x3 = x1
y3 = np.tan(x3 * np.pi / 180.0)

plt.subplot(211)
plt.plot(x1,y1,lw=1)

plt.subplot(212)
plt.plot(x3,y3,"y--",lw=3)

plt.ylabel("y_label")
plt.xlabel("x_label")
plt.title("Title")

plt.xlim(-30,390)
plt.ylim(-5,5)

plt.show()



沒有留言:

張貼留言

MQTT Explorer 與 Node-Red 介面的實驗

 MQTT Explorer 與 Node-Red 介面的實驗 MQTT EXplorer 與 Node-Red介面的設定 (1) 設定  MQTT EXplorer Client    (2)        Node-Red LED ON  --> MQTT Explor...