本文整理汇总了Python中enthought.chaco.api.OverlayPlotContainer.timer_callback方法的典型用法代码示例。如果您正苦于以下问题:Python OverlayPlotContainer.timer_callback方法的具体用法?Python OverlayPlotContainer.timer_callback怎么用?Python OverlayPlotContainer.timer_callback使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类enthought.chaco.api.OverlayPlotContainer
的用法示例。
在下文中一共展示了OverlayPlotContainer.timer_callback方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from enthought.chaco.api import OverlayPlotContainer [as 别名]
# 或者: from enthought.chaco.api.OverlayPlotContainer import timer_callback [as 别名]
def main():
from enthought.tvtk.api import tvtk
from enthought.mayavi import mlab
from enthought.enable.vtk_backend.vtk_window import EnableVTKWindow
f = mlab.figure(size=(900, 850))
m = mlab.test_mesh()
scene = mlab.gcf().scene
render_window = scene.render_window
renderer = scene.renderer
rwi = scene.interactor
# Create the plot
timer_controller = TimerController()
plots = create_plot_component(timer_controller)
specplot, timeplot, spectrogram = plots
for i, p in enumerate(plots):
p.set(resizable="", bounds=[200, 200], outer_x=0, bgcolor="transparent")
p.outer_y = i * 250
p.tools.append(MoveTool(p, drag_button="right"))
p.tools.append(PanTool(p))
p.tools.append(ZoomTool(p))
spectrogram.tools[-1].set(tool_mode="range", axis="value")
spectrogram.tools[-2].set(constrain=True, constrain_direction="y")
container = OverlayPlotContainer(bgcolor="transparent", fit_window=True)
container.add(*plots)
container.timer_callback = timer_controller.on_timer
window = EnableVTKWindow(
rwi,
renderer,
component=container,
istyle_class=tvtk.InteractorStyleTrackballCamera,
bgcolor="transparent",
event_passthrough=True,
)
mlab.show()