vault backup: 2023-05-15 17:58:49

This commit is contained in:
2023-05-15 17:58:49 +08:00
parent 9a966b4509
commit 5299474e42
2 changed files with 18 additions and 5 deletions

View File

@@ -22,6 +22,19 @@ plt.xlabel(
plt.gca().axes.get_xaxis().set_visible(False)
```
## 畫2張圖
```python
figure, axis = plt.subplots(2, 2)
```
`plt.subplots()` 來指定要畫幾張圖第一個參數是x軸的數量第二個參數是y軸的數量
`axis` 會是一個 array可以用類似座標的方式來控制你要的圖例如
```python
axis[0, 0].set_title("Sine Function")
axis[0, 1].set_title("Cosine Function")
```
`figure` 則是指外圍的大圖。
## 畫2條線
```python
plt.plot(x, y1, label='sine curve',color='b')