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

相关推荐
无心水21 小时前
基础服务系列-Jupyter Notebook 支持Java
ide·python·jupyter
zcongfly2 天前
【随手记】jupyter notebook绘制交互式图像
ide·python·jupyter
惜棠2 天前
在任意路径下简单开启jupyter notebook
ide·python·jupyter
shimly1234563 天前
如何让 vscode jupyter 访问 terminal 的环境变量?
ide·vscode·jupyter
Awesome Baron4 天前
《Learning Langchain》阅读笔记2-基于 Gemini 的 Langchain PromptTemplate 实现方式
jupyter·chatgpt·langchain·llm
Awesome Baron5 天前
《Learning Langchain》阅读笔记4-基于 Gemini 的 Langchain:组装 LLM 应用的多个部分
人工智能·python·jupyter·langchain·llm
田野与天9 天前
jupyter 文件浏览器,加强版,超好用,免费exe
ide·python·jupyter
Awesome Baron10 天前
jupyter中切换Anaconda虚拟环境
windows·python·jupyter
亲爱的老吉先森10 天前
Anconda环境下修改Jupyter notebook的启动路径(Windows)
jupyter·anaconda
_玖-幽13 天前
Python 数据分析01 环境搭建教程
大数据·python·jupyter