list - 使用列表迭代的子图标题
问题描述
我试图从 Arduino 绘制一些数据,在那里我制作了一个列表,它跟踪它正在执行的数据点。这适用于数据,但是,我无法创建子图标题,因为它插入数据点,而不是字符串名称本身。任何方式来实现它,例如,标题可以是数据点的字符串。'相关x'?
a = [x,y,z]
for k in a:
t,y_t = kryds(k,kor)
# creating grid for subplots
fig = plt.figure()
fig.set_figheight(5)
fig.set_figwidth(8.5)
ax1 = plt.subplot2grid(shape=(14, 3), loc=(0, 0), colspan=3,rowspan=3)
ax2 = plt.subplot2grid(shape=(14, 3), loc=(3, 0), colspan=3,rowspan=3)
ax3 = plt.subplot2grid(shape=(14, 3), loc=(8, 0), rowspan=6,colspan=3)
# plotting subplots
ax1.plot(range(len(k)), k)
ax1.grid(True)
ax1.set_ylabel('acceleration[g]')
ax2.plot(range(len(kor)), kor)
ax2.grid(True)
ax2.set_xlabel('Sample nr.')
ax2.set_ylabel('korrelations signal')
ax3.plot(t, y_t,'r.')
ax3.grid(True)
ax3.set_ylabel('Krydskorrelation')
ax3.set_xlabel('Forskydning [samples]')
fig.suptitle(f'correlation {k}')
plt.show()
解决方案
推荐阅读
- swift - 如何将图像从 Firebase 加载到用户头像中
- python - 条件拟合曲线
- javascript - 无法点击 svg 元素
- docker - 在 docker-compose 中使用 build comman 时出现 rpc 错误
- wpf - 在 WPF 中更改 ListBoxItem 的选择颜色
- python - 有没有办法通过导入来从我创建另一个类的实例的地方获取类名称?
- javascript - 在 react/Javscript 中使用动态键构造对象数组
- javascript - 角度 PNPM 样式问题
- java - 在 Spring Boot webapp 中找不到 .jsp 文件
- python - Apache 上的 Flask-login 在点击几下并重新加载几页后将用户设置为匿名