Exemplo n.º 1
0
 def __init__(self, **traits):
     super(MandelbrotDemo, self).__init__(**traits)
     self.data = ArrayPlotData(image=np.zeros((1, 1)))
     self.plot = Plot(self.data, padding=0)
     imgplot = self.plot.img_plot("image", colormap=reverse(Blues), interpolation="bilinear")[0]
     imgplot.tools.append( MandelbrotController(imgplot, application=self) )
     self.imgplot = imgplot
     self.plot.x_axis.visible = False
     self.plot.y_axis.visible = False
Exemplo n.º 2
0
 def change_color_map(self):
     try:
         cmap_func = getattr(cmaps, self.current_map)
         if self.reverse_map:
             cmap_func = reverse(cmap_func)
         self.imgplot.color_mapper = cmap_func(DataRange1D(self.imgplot.value))
         self.plot.request_redraw()
     except:
         print "Cannot set color map:%s" % self.current_map