matplotlib交互式绘图与切片的图像

时间:2015-03-19 22:18:53

标签: python matplotlib ipython bokeh chaco

我如何制作像这里显示的互动情节?我想在一个可以通过点击图像进行调整的点上显示图像的x和y切片图像。

desired interactive plot where the image can be clicked to adjust the position of the slices

我知道这个是在Chaco制作的,但由于Chaco与python3不兼容,所以只需使用matplotlib或散景。

1 个答案:

答案 0 :(得分:0)

使用tacaswells建议,我发现泡泡糖中的cross_section_2d正是我所寻找的。

首先我从github https://github.com/Nikea/bubblegum.git

安装了bubblegum

然后以下设置横截面图像

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()

谢谢!

相关问题