【问题标题】:matplotlib interactive plot with slices of image [closed]带有图像切片的matplotlib交互式绘图[关闭]
【发布时间】:2015-03-19 22:18:52
【问题描述】:

我如何制作一个像这里显示的那样的交互式绘图?我想显示一张图像,其中包含在可以通过单击图像进行调整的点处拍摄的图像的 x 和 y 切片。

我知道这是在 Chaco 制作的,但由于 Chaco 与 python3 不兼容,所以最好使用 matplotlib 或 bokeh。

【问题讨论】:

标签: python matplotlib ipython bokeh chaco


【解决方案1】:

使用 tacaswells 的建议,我发现泡泡糖中的 cross_section_2d 正是我想要的。

首先我从 github https://github.com/Nikea/bubblegum.git 安装了泡泡糖

然后下面设置一个横断面图片

import matplotlib.pyplot as plt
import numpy as np
from bubblegum.backend.mpl.cross_section_2d import CrossSection
fig= plt.figure()
cs= CrossSection(fig)
img= np.random.rand(100,100)
cs.update_image(img)
plt.show()

谢谢!

【讨论】:

    猜你喜欢
    • 2017-04-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-01-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-10-05
    相关资源
    最近更新 更多