Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setcolorcell does not work when no colormap is selected (2.8.0) #183

Open
jypeter opened this issue Apr 27, 2017 · 0 comments
Open

setcolorcell does not work when no colormap is selected (2.8.0) #183

jypeter opened this issue Apr 27, 2017 · 0 comments
Milestone

Comments

@jypeter
Copy link
Member

jypeter commented Apr 27, 2017

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)
>>>
@doutriaux1 doutriaux1 modified the milestone: 3.0 May 5, 2017
@doutriaux1 doutriaux1 modified the milestones: 3.0, Next Release Mar 29, 2018
@doutriaux1 doutriaux1 modified the milestones: 8.1, 8.2 Mar 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants