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

相关推荐
电饭叔20 小时前
Jupyter学习中的问题--FileNotFoundError
ide·学习·jupyter
-To be number.wan2 天前
为什么 pyecharts 在 Jupyter Notebook 里显示空白?
ide·python·jupyter·数据分析
维度攻城狮7 天前
交互式机器人编程:使用Jupyter Notebook运行ROS2程序
jupyter·机器人·ros2
爱喝可乐的老王7 天前
Jupyter Notebook 的内核切换
linux·ide·jupyter
张小凡vip7 天前
数据挖掘(八)--让Jupyter notebook支持R语言环境
jupyter·数据挖掘·r语言
张小凡vip9 天前
数据挖掘(七) ---Jupyter Notebook快捷方式和魔术命令(特殊命令)
人工智能·jupyter·数据挖掘
QQ__176461982414 天前
SSH远程通过Vscode运行Jupyter无法使用CUDA
vscode·jupyter·ssh
Thomas214315 天前
jupyterhub on k8s jupyter总是无响应
jupyter·容器·kubernetes
pulinzt15 天前
【python】第六节anacoda+配置Jupyter notebook
人工智能·python·jupyter
Volunteer Technology19 天前
Centos7安装python和jupyter
linux·python·jupyter