vault backup: 2023-05-15 17:58:49
This commit is contained in:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user