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

相关推荐
->yjy3 天前
jupyter版本所引起的扩展插件问题
人工智能·python·jupyter
纪伊路上盛名在4 天前
ML基础-Jupyter notebook中的魔法命令
linux·服务器·人工智能·python·jupyter
请为小H留灯4 天前
Python 数据清洗与处理常用方法全解析
大数据·python·jupyter·pandas
请为小H留灯8 天前
Python读写各类数据文件
开发语言·python·jupyter·sqlite·json
cuber膜拜9 天前
jupyter使用 Token 认证登录
ide·python·jupyter
鲤鱼不懂11 天前
jupyter notebook环境问题
pytorch·python·jupyter
九品神元师11 天前
jupyter配置说明
linux·ide·jupyter
心惠天意11 天前
docker-compose篇---创建jupyter并可用sudo的创建方式
docker·jupyter·容器
XYX的Blog13 天前
Numpy基础01(Jupyter基本用法/Ndarray创建与基本操作)
jupyter·numpy
skywalk816313 天前
Windows下建立Jupyter-lab 编程环境
ide·windows·python·jupyter