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

相关推荐
维度攻城狮1 天前
交互式机器人编程:使用Jupyter Notebook运行ROS2程序
jupyter·机器人·ros2
爱喝可乐的老王1 天前
Jupyter Notebook 的内核切换
linux·ide·jupyter
张小凡vip2 天前
数据挖掘(八)--让Jupyter notebook支持R语言环境
jupyter·数据挖掘·r语言
张小凡vip3 天前
数据挖掘(七) ---Jupyter Notebook快捷方式和魔术命令(特殊命令)
人工智能·jupyter·数据挖掘
QQ__17646198248 天前
SSH远程通过Vscode运行Jupyter无法使用CUDA
vscode·jupyter·ssh
Thomas21439 天前
jupyterhub on k8s jupyter总是无响应
jupyter·容器·kubernetes
pulinzt9 天前
【python】第六节anacoda+配置Jupyter notebook
人工智能·python·jupyter
Volunteer Technology13 天前
Centos7安装python和jupyter
linux·python·jupyter
weixin_4404016914 天前
Win11 系统 Anaconda 下载+conda命令+Jupyter Notebook+VS Code
ide·python·jupyter·conda
70asunflower15 天前
Jupyter Notebook 详细快捷键操作指南
ide·python·jupyter