Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

msno.matrix() shows an error when I use any venv using pyenv

I tried many times installing several virtual environments using pyenv, but the system shows a error in missingno library. This is : msno.matrix(df)

`ValueError                                Traceback (most recent call last)
Cell In[17], line 1
----> 1 msno.matrix(df)

File c:\Users\sarud\.pyenv\venvs\ETLs\lib\site-packages\missingno\missingno.py:72, in matrix(df, filter, n, p, sort, figsize, width_ratios, color, fontsize, labels, sparkline, inline, freq, ax)
     70 # Remove extraneous default visual elements.
     71 ax0.set_aspect('auto')

---> 72 ax0.grid(b=False)
     73 ax0.xaxis.tick_top()
     74 ax0.xaxis.set_ticks_position('none')

File c:\Users\sarud\.pyenv\venvs\ETLs\lib\site-packages\matplotlib\axes\_base.py:3196, in _AxesBase.grid(self, visible, which, axis, **kwargs)
   3194 _api.check_in_list(['x', 'y', 'both'], axis=axis)
   3195 if axis in ['x', 'both']:
-> 3196     self.xaxis.grid(visible, which=which, **kwargs)
   3197 if axis in ['y', 'both']:
   3198     self.yaxis.grid(visible, which=which, **kwargs)

File c:\Users\sarud\.pyenv\venvs\ETLs\lib\site-packages\matplotlib\axis.py:1655, in Axis.grid(self, visible, which, **kwargs)
   1652 if which in ['major', 'both']:
   1653     gridkw['gridOn'] = (not self._major_tick_kw['gridOn']
   1654                         if visible is None else visible)
-> 1655     self.set_tick_params(which='major', **gridkw)
   1656 self.stale = True
...
   1073             % (key, allowed_keys))
   1074 kwtrans.update(kw_)
   1075 return kwtrans

ValueError: keyword grid_b is not recognized; valid keywords are ['size', 'width', 'color', 'tickdir', 'pad', 'labelsize', 'labelcolor', 'zorder', 'gridOn', 'tick1On', 'tick2On', 'label1On', 'label2On', 'length', 'direction', 'left', 'bottom', 'right', 'top', 'labelleft', 'labelbottom', 'labelright', 'labeltop', 'labelrotation', 'grid_agg_filter', 'grid_alpha', 'grid_animated', 'grid_antialiased', 'grid_clip_box', 'grid_clip_on', 'grid_clip_path', 'grid_color', 'grid_dash_capstyle', 'grid_dash_joinstyle', 'grid_dashes', 'grid_data', 'grid_drawstyle', 'grid_figure', 'grid_fillstyle', 'grid_gapcolor', 'grid_gid', 'grid_in_layout', 'grid_label', 'grid_linestyle', 'grid_linewidth', 'grid_marker', 'grid_markeredgecolor', 'grid_markeredgewidth', 'grid_markerfacecolor', 'grid_markerfacecoloralt', 'grid_markersize', 'grid_markevery', 'grid_mouseover', 'grid_path_effects', 'grid_picker', 'grid_pickradius', 'grid_rasterized', 'grid_sketch_params', 'grid_snap', 'grid_solid_capstyle', 'grid_solid_joinstyle', 'grid_transform', 'grid_url', 'grid_visible', 'grid_xdata', 'grid_ydata', 'grid_zorder', 'grid_aa', 'grid_c', 'grid_ds', 'grid_ls', 'grid_lw', 'grid_mec', 'grid_mew', 'grid_mfc', 'grid_mfcalt', 'grid_ms']`

I don't know the error, but I installed a similar virtualenv using conda doesn't show that error.

I installed different python versions using pyenv (3.11.2, 3.7.6, 3.9.13, 3.9.5), but in each one shows the same error when I install missingno. I show the image on error, I use VS code as IDE. At beginning, I thought it was the VS code version, but installing libraries using conda the error doesn't appeear.

like image 539
Ruben Miranda Avatar asked Sep 18 '25 20:09

Ruben Miranda


2 Answers

I'm having the same issue. Agree with Ziyuan, it seems like a recent update of matplotlib changed argument b to visible.

The latest version of missingno (0.5.2) through pip have updated the argument name passed to matplotlib, but anaconda only provide version (0.4.2) and therefore having the issue. You can still plot graph even with this error but column label is disappeared.

Solution: get into missingno.py, search for grid(b=False) and update it to grid(visible=False). There should be 3 occurrences.

Once you done that, return to your own code, re-import the missingno package and it should work.

like image 174
Ray Z Avatar answered Sep 21 '25 11:09

Ray Z


I believe argument b has been renamed to visible.

An earlier version: matplotlib/axes/_base.py

A recent version: matplotlib/axes/_base.py

like image 41
ziyuang Avatar answered Sep 21 '25 13:09

ziyuang