You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have some (old) scripts where I change by hand all the colormap entries I know I will need, and therefore don't set a colormap. This used to work fine with older versions of vcs, but it is broken now.
If you don't want the user to change the default colormap (but in the case below, it seems my default colormap is viridis and not default), then you should trap this error and show an error message
>>> import vcs
>>> x = vcs.init()
>>> x.getcolormapname()
'viridis'
>>> x.setcolorcell(21,100,0,0)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/share/unix_files/cdat/miniconda2/envs/cdatm14/lib/python2.7/site-packages/vcs/Canvas.py", line 5170, in setcolorcell
a = vcs.setcolorcell(self.colormap, *args)
File "/home/share/unix_files/cdat/miniconda2/envs/cdatm14/lib/python2.7/site-packages/vcs/utils.py", line 1903, in setcolorcell
cmap = getcolormap(obj.colormap)
AttributeError: 'NoneType' object has no attribute 'colormap'
>>> x.setcolormap('viridis')
>>> x.setcolorcell(21,100,0,0)
>>>
The text was updated successfully, but these errors were encountered:
I have some (old) scripts where I change by hand all the colormap entries I know I will need, and therefore don't set a colormap. This used to work fine with older versions of vcs, but it is broken now.
If you don't want the user to change the default colormap (but in the case below, it seems my default colormap is viridis and not default), then you should trap this error and show an error message
The text was updated successfully, but these errors were encountered: