Plot highlighting using alpha values
I recently added support for changing the alpha of a plot after it has been constructed. Combined with a selection tool you get a really nice highlight feature. In this example, when a plot is selected I double its width and set the alpha of the other plots to 1/3 of their normal value.

def _select(self, selected):
""" Decorates a plot to indicate it is selected """
for plot in reduce(operator.add, selected.container.plots.values()):
if plot != selected:
plot.alpha /= 3
else:
plot.line_width *= 2
plot.request_redraw()
def _deselect(self, selected):
for plot in reduce(operator.add, selected.container.plots.values()):
if plot != selected:
plot.alpha *= 3
else:
plot.line_width /= 2
plot.request_redraw()
It looks great. I’m just getting started with the tool suite. Can you show a complete example using the _select code?
Comment on October 5, 2008 @ 6:06 pm