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

Overwriting option for matplotlib2vcs? #261

Open
lee1043 opened this issue Sep 28, 2017 · 2 comments
Open

Overwriting option for matplotlib2vcs? #261

lee1043 opened this issue Sep 28, 2017 · 2 comments
Milestone

Comments

@lee1043
Copy link
Contributor

lee1043 commented Sep 28, 2017

vcs.colors.matplotlib2vcs(cmap, vcs_name=None)

https://uvcdat.llnl.gov/docs/vcs/misc/colors.html

When converting matplotlib colormap to VCS, by default vcs_name becomes same as the matplotlib colormap, or you can assign your own name. But if the name is already being used as one of original VCS colormap, it assign "_001" at the end of name.

run:

import matplotlib.pyplot as plt
import vcs
cm=vcs.colors.matplotlib2vcs('inferno')

message:

/Users/lee1043/anaconda2/envs/uvcdat-2.12/lib/python2.7/site-packages/vcs/colors.py:38: UserWarning: inferno colormap name was already existing, your colormap name will be: inferno_mpl_000
  (vcs_name, vcs_name_final))

run:

cm=vcs.colors.matplotlib2vcs('inferno', vcs_name='inferno')

message:

/Users/lee1043/anaconda2/envs/uvcdat-2.12/lib/python2.7/site-packages/vcs/colors.py:38: UserWarning: inferno colormap name was already existing, your colormap name will be: inferno_mpl_001
  (vcs_name, vcs_name_final))

Wondering if we can have "overwrite" option.

@doutriaux1
Copy link
Contributor

@lee1043 that's a nice idea, I'll add this. Might want to protect the vcs defaults such inferno though.

@lee1043
Copy link
Contributor Author

lee1043 commented Sep 29, 2017

@doutriaux1 agreed, overwriting should be optional, not default.

@doutriaux1 doutriaux1 added this to the Next Release milestone 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
Projects
None yet
Development

No branches or pull requests

2 participants