本文整理匯總了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()