Exemple #1
0
 def _update_slice_graphs(self, event=None):
     if event is None:
         return
     x, y = plotutils.mouse_event_to_coordinates(self._overview, event)
     if not x:
         return
     x, y = int(x), int(y)
     if x < 0 or x >= self._data.shape[0] \
        or y < 0 or y >= self._data.shape[1]:
         return
     self._vertical_curve.setData(y=self._data[x, ...])
     self._horizontal_curve.setData(y=self._data[..., y])
Exemple #2
0
 def _update_cursor_info(self, event=None):
     x, y, value = float('nan'), float('nan'), float('nan')
     if event:
         x, y = plotutils.mouse_event_to_coordinates(self._overview, event)
         if not x:
             return
         x, y = int(x), int(y)
         if x >= 0 and x < self._data.shape[0] \
            and y >= 0 and y < self._data.shape[1]:
             value = self._data[x, y]
     legend = ['x = {0}'.format(x), 'y = {0}'.format(y),
               'value = {0:.5g}'.format(value)]
     self._info.update_entry(_CURSOR_GROUP, '<br/>'.join(legend))
Exemple #3
0
    def _update_values_info(self, event=None):
        """Update info text on mouse move event.

        Uses proxy to reduce number of events.
        """
        if event:
            x, y = plotutils.mouse_event_to_coordinates(self._plot, event)
            if not x:
                return
            values = [plotutils.get_data_item_value(di, x)
                      for di in self._plot.listDataItems()]
        else:
            values = len(self._plot.listDataItems())*[float('nan')]
        self._update_info(_VALUE_GROUP, values)