def set_side_colorbar(self, side, nvalues=10): from caid.graphics.colorbar import colorbar as cbar # Create a colorbar array... C = np.linspace(self.vmin,self.vmax,nvalues).astype(np.float32) colorbar = cbar(C, colormap=self.colormap, side=side) self._colorbar = colorbar self._side_colorbar = side
def set_side_colorbar(self, side, nvalues=10): from caid.graphics.colorbar import colorbar as cbar # Create a colorbar array... C = np.linspace(self.vmin, self.vmax, nvalues).astype(np.float32) colorbar = cbar(C, colormap=self.colormap, side=side) self._colorbar = colorbar self._side_colorbar = side
def update(self, colormap=None, colorbar=None, field=None, clean=False, n=None, force=False): if colormap is not None: self._colormap = colormap force = True if colorbar is not None: self._colorbar = colorbar force = True if field is not None: self._field = field force = True print(("show_colorbar ", self.show_colorbar)) self.updateVertexBuffer(colormap=colormap, field=field, n=n, force=force) if self.show_colorbar: if self.colorbar is None: from caid.graphics.colorbar import colorbar as cbar # Create a colorbar array... nvalues = 10 C = np.linspace(self.vmin, self.vmax, nvalues).astype(np.float32) colorbar = cbar(C, colormap=colormap, side='left'\ , xmin = self.xmin \ , ymin = self.ymin \ , zmin = self.zmin \ , xmax = self.xmax \ , ymax = self.ymax \ , zmax = self.zmax \ ) self._colorbar = colorbar print(">>> Enter colorbar VB") self.updateVertexBuffer( colormap=colormap \ , field=self.colorbar \ , n=[10,10] \ , force=force) self.finalizeVertexBuffer(colormap=colormap, field=self.colorbar, n=n, force=force)
def update(self, colormap=None, colorbar=None, field=None, clean=False, n=None, force=False): if colormap is not None: self._colormap = colormap force = True if colorbar is not None: self._colorbar = colorbar force = True if field is not None: self._field = field force = True print("show_colorbar ", self.show_colorbar) self.updateVertexBuffer(colormap=colormap, field=field, n=n, force=force) if self.show_colorbar: if self.colorbar is None: from caid.graphics.colorbar import colorbar as cbar # Create a colorbar array... nvalues = 10 C = np.linspace(self.vmin,self.vmax,nvalues).astype(np.float32) colorbar = cbar(C, colormap=colormap, side='left'\ , xmin = self.xmin \ , ymin = self.ymin \ , zmin = self.zmin \ , xmax = self.xmax \ , ymax = self.ymax \ , zmax = self.zmax \ ) self._colorbar = colorbar print(">>> Enter colorbar VB") self.updateVertexBuffer( colormap=colormap \ , field=self.colorbar \ , n=[10,10] \ , force=force) self.finalizeVertexBuffer(colormap=colormap, field=self.colorbar, n=n, force=force)