-
Notifications
You must be signed in to change notification settings - Fork 13
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
Cannot write SVGs of images with 'gray' colormap #13
Comments
Ah, I am seeing #5 now. If we are okay with all in matplotlib, but not in vispy colormaps failing except for |
Yeah, let's do option 1 which maybe some try/ catch that if a colormap isn't found you just get We could do option 3 depending on how long it takes to address #5, but for now the quick solution is ok I think |
Sounds good. I will implement this in #12 ! |
Closed by #12 |
Description
As described in #12, napari uses
gray
, a matplotlib colormap the default. While this works in napari, since the matplotlib colormaps have been vendored, this does not work here because the SVG writer uses the vispyget_colormap()
function, which depends on matplotlib for the grayscale colormap is calledgray
(see here). vispy however, does support a grayscale colormap called 'grays' without matplotlib.Possible fixes
gray
tograys
for this plugin. Although, now that I think about it, there are probably other colormaps that would fail for the same reason...probably not the best fix.napari
a dependency of this plugin and use the colormap machinery from there.Option 3 seems like the easiest thing to do for now, but it nice conceptually that napari plugins don't rely on napari. That being said, moving to our own colormap system is on the roadmap, so this would likely be a somewhat temporary thing. Further, for now, I think pretty much everyone is going to use this plugin as it comes with
napari
, so it's probably not a big deal to make napari a dependency.To reproduce:
With napari installed from pip in a fresh environment:
Gives the following error:
The text was updated successfully, but these errors were encountered: