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后端。显示图表后,你可以使用鼠标滚轮进行缩放。

相关推荐
cndes21 小时前
安装Miniconda+Jupyter notebook
ide·python·jupyter
典典分享指南1 天前
用大模型把写作 SOP 变成可复用 Prompt
docker·jupyter·eclipse·phpstorm·myeclipse
JTaoX8 天前
pycharm 集成本地 jupyter notebook
ide·jupyter·pycharm
晨曦花锦10 天前
从零搭建 Jupyter Notebook 远程开发环境
python·jupyter
小小尚@18 天前
AE脚本-AE Actions v1.1.8 操作动作记录器
开发语言·前端·javascript·jupyter·postman
赵广陆23 天前
Jupyter和PyCharm完整集成
ide·jupyter·pycharm
营养充电站23 天前
C++23 新特性在 CLion 中的实战体验
macos·docker·jupyter·正则表达式
营养充电站25 天前
KMP全栈开发:从Android到AI Agent的技术演进与实践
人工智能·算法·docker·jupyter
sphw1 个月前
nixnb: Jupyter Notebook 优雅分享
ide·人工智能·jupyter
编程阿峰1 个月前
Python 环境配置(二)安装jupyter、matplotlib、numpy库
开发语言·python·jupyter·numpy·matplotlib