python画图纵坐标起点不是0
时间: 2023-12-05 18:45:58 浏览: 152
在Python中,如果你想要设置纵坐标的起点为0,可以使用`plt.ylim`函数来设置纵坐标的范围。在你提供的代码中,你可以在`plt.ylim`函数中设置纵坐标的起点为0,如下所示:
```python
plt.ylim((0, 3))
```
这样就可以将纵坐标的起点设置为0了。希望对你有帮助!\[2\]
#### 引用[.reference_title]
- *1* *3* [Python画图整理](https://blog.csdn.net/qq_45822805/article/details/120433190)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [matplotlib画图之坐标轴移动(python)](https://blog.csdn.net/weixin_33698823/article/details/93180855)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文