matplotlib vmin/vmax and norm simultaneously passed
See original GitHub issueEnvironment data
- VS Code version: 1.68.1
- Jupyter Extension version (available under the Extensions sidebar): Yes
- Python Extension version (available under the Extensions sidebar): v2022.8.1
- OS (Windows | Mac | Linux distro) and version: WSL2
- Python and/or Anaconda version: 3.7
- Type of virtual environment used (N/A | venv | virtualenv | conda | …): conda
- Jupyter server running: Local | Remote | remote
Expected behaviour
When using hp.mollview(np.zeros(hp.nside2npix(1024))), a matplotlib plot should be drawn, in mollview projection.
Actual behaviour
Some args/kwargs seem to be incorrectly passed. Above code doesn’t even use ‘norm’ or vmin/vmax parameters. And even when passing them it causes the same error.
My Jupyer notebkook works when using a different Jupyter service (i.e. using NERSC webservice for running). When connecting via my VScode, for about a week now, using hp.mollview or hp.cartview, … , produces this error
Steps to reproduce:
- Create a notebook
- run inside this notebook
import numpy as np
import healpy as hp
hp.mollview(np.zeros(hp.nside2npix(1024)))
Logs
Output for Jupyter
in the Output
panel (View
→Output
, change the drop-down the upper-right of the Output
panel to Jupyter
)
ValueError Traceback (most recent call last)
/tmp/ipykernel_1257/3095137169.py in <module>
----> 1 hp.mollview(np.ones(shape=hp.nside2npix(1024)))
~/.local/lib/python3.7/site-packages/healpy/visufunc.py in mollview(map, fig, rot, coord, unit, xsize, title, nest, min, max, flip, remove_dip, remove_mono, gal_cut, format, format2, cbar, cmap, badcolor, bgcolor, notext, norm, hold, reuse_axes, margins, sub, nlocs, return_projected_map)
258 badcolor=badcolor,
259 bgcolor=bgcolor,
--> 260 norm=norm,
261 )
262 if cbar:
~/.local/lib/python3.7/site-packages/healpy/projaxes.py in projmap(self, map, nest, **kwds)
734 nside = pixelfunc.npix2nside(pixelfunc.get_map_size(map))
735 f = lambda x, y, z: pixelfunc.vec2pix(nside, x, y, z, nest=nest)
--> 736 return super(HpxMollweideAxes, self).projmap(map, f, **kwds)
737
738
~/.local/lib/python3.7/site-packages/healpy/projaxes.py in projmap(self, map, vec2pix_func, xsize, **kwds)
724 def projmap(self, map, vec2pix_func, xsize=800, **kwds):
725 self.proj.set_proj_plane_info(xsize=xsize)
--> 726 img = super(MollweideAxes, self).projmap(map, vec2pix_func, **kwds)
727 self.set_xlim(-2.01, 2.01)
728 self.set_ylim(-1.01, 1.01)
~/.local/lib/python3.7/site-packages/healpy/projaxes.py in projmap(self, map, vec2pix_func, vmin, vmax, badval, badcolor, bgcolor, cmap, norm, rot, coord, **kwds)
209 vmin=vmin,
210 vmax=vmax,
--> 211 **kwds
212 )
213 xmin, xmax, ymin, ymax = self.proj.get_extent()
~/.conda/envs/py3.7/lib/python3.7/site-packages/matplotlib/_api/deprecation.py in wrapper(*args, **kwargs)
454 "parameter will become keyword-only %(removal)s.",
455 name=name, obj_type=f"parameter of {func.__name__}()")
--> 456 return func(*args, **kwargs)
457
458 # Don't modify *func*'s signature, as boilerplate.py needs it.
~/.conda/envs/py3.7/lib/python3.7/site-packages/matplotlib/__init__.py in inner(ax, data, *args, **kwargs)
1410 def inner(ax, *args, data=None, **kwargs):
1411 if data is None:
-> 1412 return func(ax, *map(sanitize_sequence, args), **kwargs)
1413
1414 bound = new_sig.bind(ax, *args, **kwargs)
~/.conda/envs/py3.7/lib/python3.7/site-packages/matplotlib/axes/_axes.py in imshow(self, X, cmap, norm, aspect, interpolation, alpha, vmin, vmax, origin, extent, interpolation_stage, filternorm, filterrad, resample, url, **kwargs)
5491 # image does not already have clipping set, clip to axes patch
5492 im.set_clip_path(self.patch)
-> 5493 im._scale_norm(norm, vmin, vmax)
5494 im.set_url(url)
5495
~/.conda/envs/py3.7/lib/python3.7/site-packages/matplotlib/cm.py in _scale_norm(self, norm, vmin, vmax)
379 if norm is not None:
380 raise ValueError(
--> 381 "Passing parameters norm and vmin/vmax simultaneously is "
382 "not supported. Please pass vmin/vmax directly to the "
383 "norm when creating it.")
ValueError: Passing parameters norm and vmin/vmax simultaneously is not supported. Please pass vmin/vmax directly to the norm when creating it.
Issue Analytics
- State:
- Created a year ago
- Comments:21 (11 by maintainers)
Top Results From Across the Web
Passing parameters norm and vmin/vmax simultaneously is ...
On matplotlib.pyplot.imshow it says "It is deprecated to use vmin/vmax when norm is given." So when using simple_norm it will give this warning ......
Read more >Matplotlib: ValueError even when passing vmin/vmax to Norm?
Yet my process is killed due to the error: ValueError: Passing parameters norm and vmin/vmax simultaneously is not supported.
Read more >API Changes — Matplotlib 3.3.0 documentation
Passing parameters norm and vmin/vmax simultaneously to functions using colormapping such as scatter() and imshow() is deprecated.
Read more >Exercise: Advanced Uses of SHAP Values - Kaggle
"ValueError: Passing parameters norm and vmin/vmax simultaneously is not supported. Please pass vmin/vmax directly to the norm when creating it.".
Read more >Passing a Normalize instance simultaneously with vmin/vmax ...
Hi am trying to develop heatmap plot using hclust2 for my data. I updated latest versions of matplotlib to latest version 1.6.1.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Looks like the root cause of the problem is the Conda Environment isn’t getting activated properly on remote SSH. Duplicate of https://github.com/microsoft/vscode-jupyter/issues/11207
Well, your help is very appreciated.
You may find this ‘kernel-helper’ in the log. It is someting we use for customizing jupyter: https://docs.nersc.gov/services/jupyter/#customizing-kernels-with-a-helper-shell-script
The following shows verbose output between firing up VS code and connecting to the host, (I hope I am not opening backdoors here for anyone…)
Jupyter: Show Output Jupyter
from VS code - verboseThis shows the output after connection to host and until failure of the jupyter cell
Jupyter: Show Output Jupyter
from VS code - verbose