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

相关推荐
HackerTom4 天前
vs code jupyter连gpu结点kernel
python·jupyter·gpu·vs code·远程
Hcoco_me6 天前
YOLOv5(三):Jupyter
ide·yolo·jupyter
x_lrong8 天前
Linux虚拟机配置jupyter环境并在宿主机访问
linux·运维·笔记·jupyter·虚拟机
24kHT8 天前
conda以及Jupyter notebook的使用
windows·jupyter·conda
一个数据大开发10 天前
【零基础一站式指南】Conda 学习环境准备与 Jupyter/PyCharm 完全配置
学习·jupyter·conda
nvd1111 天前
asyncio.run() vs asyncio.gather():启动器与聚合器, 为何Jupyter notebook里能直接使用await?
开发语言·python·jupyter
EEG小佬11 天前
Jupyter选择内核时如何找到虚拟环境
ide·python·jupyter
家有狸花13 天前
Pycharm 中jupyter notebook变量窗口只显示特殊变量
ide·jupyter·pycharm
疯狂的小强呀14 天前
如何利用 Jupyter 从浏览器访问远程服务器
服务器·jupyter·浏览器访问服务器·jupyter远程访问服务器