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

相关推荐
小oo呆44 分钟前
【学习心得】Jupyter 如何在conda的base环境中其他虚拟环境内核
python·jupyter·conda
suoxiao7772 天前
通过anaconda安装jupyter
ide·python·jupyter
cocogogogo6 天前
Jupyter Notebook / Lab 疑难杂症记:从命令找不到到环境冲突与网络阻塞的排查实录
网络·ide·jupyter
娱乐我有8 天前
姚琛全新特别版EP上线 携手金牌制作人诠释夏日浪漫
jupyter
cocogogogo9 天前
配置Jupyter Notebook环境及Token认证(Linux服务器)
linux·服务器·jupyter
bicijinlian10 天前
多语言笔记系列:Polyglot Notebooks 中使用扩展库
jupyter·c#·polyglot·notebooks·c# jupyter·.net jupyter·.net notebook
我不是小upper10 天前
Jupyter Notebook为什么适合数据分析?
ide·jupyter·数据分析
胡桃不是夹子11 天前
conda配置好的pytorch在jupyter中如何配置
pytorch·jupyter·conda
郁金香很忙14 天前
新环境注册为Jupyter 内核
python·jupyter
DeePlaskin14 天前
Jupyter notebook快捷键
ide·python·jupyter