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

相关推荐
く成哦9 小时前
部署Apache Gravitino项目及使用教程
jupyter·docker-compose·apache·trino·playground·gravitino
winfred_hua4 天前
PyCharm中使用jupyter
ide·jupyter·pycharm
傲笑风9 天前
jupyter转PDF教程
python·jupyter
一晌小贪欢10 天前
第1节:数据分析环境配置——Jupyter Notebook全攻略
jupyter·数据挖掘·数据分析·可视化·数据可视化
袋子(PJ)12 天前
2026年pytorch基础学习(基于jupyter notebook开发)——从原理到落地:PyTorch神经网络架构与工程优化解析
人工智能·pytorch·深度学习·学习·jupyter
拜托啦!狮子13 天前
本地连接服务器并运行jupyter
服务器·jupyter·github
iwS2o90XT13 天前
开发一个VS Code主题插件,定制你的IDE
ide·jupyter·postman
WL_Aurora17 天前
如何将 Jupyter Notebook (.ipynb) 文件转换为 Python (.py) 文件
python·jupyter
好奇龙猫23 天前
[大学院-python-base gammer learning(1): setting conda + Jupyter ]
python·jupyter·conda