【问题标题】:How can I listen for changes in one plot's traits and update the second by that amount?如何监听一个情节特征的变化并按该数量更新第二个情节?
【发布时间】:2013-08-19 15:55:48
【问题描述】:

https://github.com/enthought/chaco/blob/master/examples/demo/edit_line.py

我想要的结果是并排有两个图,左边是这个edit_line.py 图,右边显示edit_line.py 和另一个数组中的y 值之和。

现在我可以从PointDraggingTool 中查看self.component.indexself.component.value(分别为x 和y)。但是,我需要能够根据第一个图的更新来更新第二个图。我将如何聆听第一个情节特征的变化并按该数量更新第二个情节?

【问题讨论】:

    标签: python events traits enthought chaco


    【解决方案1】:

    我已经想通了——我会尽快发布合适的解决方案。

    总而言之,它需要使用on_trait_change(self.lineplot.value, self._handle_data_change, name="data_changed") 监听第一个图的更新并重新绘制第二个图

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-10-11
      • 1970-01-01
      • 1970-01-01
      • 2023-03-25
      • 1970-01-01
      • 2019-08-29
      • 2022-01-06
      • 2020-06-14
      相关资源
      最近更新 更多