jupyter中如何看plt.plot的局部细节

在Jupyter中使用matplotlib时,如果你想要放大图表的某一部分,可以使用matplotlib的交互式方式查看局部细节。

python 复制代码
%matplotlib notebook  # 在Jupyter中使用交互式后端
import matplotlib.pyplot as plt
import numpy as np
 
# 生成数据
x = np.linspace(0, 10, 1000)
y = np.sin(x)
 
# 绘制图形
plt.plot(x, y)

上述代码中,%matplotlib notebook魔法命令使得Jupyter使用的是兼容notebook的交互式matplotlib后端。显示图表后,你可以使用鼠标滚轮进行缩放。

相关推荐
喆星时瑜3 天前
探索 Anaconda 中的 JupyterLab、Jupyter Notebook、iPython 解释器(Qt 控制台)和 Spyder IDE
ide·jupyter·ipython
开开心心就好15 天前
手机虚拟化学实验室,混合燃烧都能模拟
jupyter·智能手机·ffmpeg·计算机外设·电脑·音视频·visual studio
53488736abcdefg19 天前
Anaconda+Jupyter+NumPy
jupyter·numpy·anaconda
weixin_4617694020 天前
VS Code 中创建 Jupyter 文件(.ipynb)
ide·python·jupyter
*wait for?22 天前
利用uv安装python包,并运行jupyter
python·jupyter·uv
程序员清风1 个月前
Python 数据分析环境搭建:从 Jupyter 到 pandas
python·jupyter·数据分析
oooost1 个月前
Jupyter Notebook 常用快捷键速查
ide·python·jupyter
开开心心_Every1 个月前
文件夹批量创建工具支持同级和多层级
运维·服务器·游戏·jupyter·智能手机·pdf·postman
Xiu Yan1 个月前
Python 数据分析:Pandas DataFrame 零基础入门教程
python·jupyter·pycharm·numpy·pandas
Xiu Yan1 个月前
Python 数据分析:Pandas Series 零基础入门教程
python·jupyter·pycharm·numpy·pandas