Lenty / SLiCAP_python

Open-source version of SLiCAP, implemented in python
Other
33 stars 15 forks source link

ValueError: keyword grid_b is not recognized #39

Closed arjenjellema closed 1 year ago

arjenjellema commented 1 year ago

In a Windows / python 3.9.2 environment the following error occurred:

        Compiling library: SLiCAPmodels.lib.
        Checking netlist: C:\...\SLiCAP_python\files\examples\myFirstRCnetwork/cir/myFirstRCnetwork.cir
        s
        Traceback (most recent call last):
          File "C:\...\SLiCAP_python\files\examples\myFirstRCnetwork\myFirstRCnetwork.py", line 90, in <module>
            figMag = plotSweep('RCmag', 'Magnitude characteristic', numGain, 10, '100k', 100, yUnits = '-', show = True)
          File "C:\...\Python39\site-packages\SLiCAP\SLiCAPplots\SLiCAPplots.py", line 859, in plotSweep
            fig.plot()
          File "C:\...\Python39\site-packages\SLiCAP\SLiCAPplots\SLiCAPplots.py", line 353, in plot
            defaultsPlot()
          File "C:\...\Python39\site-packages\SLiCAP\SLiCAPplots\SLiCAPplots.py", line 370, in defaultsPlot
            fig.axes[i].grid(b=True, which='major', color='0.5',linestyle='-')
          File "C:\...\Python39\lib\site-packages\matplotlib\axes\_base.py", line 3196, in grid
            self.xaxis.grid(visible, which=which, **kwargs)
          File "C:\...\Python39\lib\site-packages\matplotlib\axis.py", line 1655, in grid
            self.set_tick_params(which='major', **gridkw)
          File "C:\...\Python39\lib\site-packages\matplotlib\axis.py", line 927, in set_tick_params
            kwtrans = self._translate_tick_params(kwargs)
          File "C:\...\Python39\lib\site-packages\matplotlib\axis.py", line 1071, in _translate_tick_params
            raise ValueError(
        ValueError: keyword grid_b is not recognized; valid keywords are ['size', 'width', 'color', ... ]

Fixed by changing "C:...\Python39\site-packages\SLiCAP\SLiCAPplots\SLiCAPplots.py" lines 370-371 from:

fig.axes[i].grid(b=True, which='major', color='0.5',linestyle='-')
fig.axes[i].grid(b=True, which='minor', color='0.5',linestyle=':')

to:

fig.axes[i].grid(which='major', color='0.5', linestyle='-')
fig.axes[i].grid(which='minor', color='0.5', linestyle=':')

Was my installation wrong or was I perhaps missing something or did someone encounter this error before? matplotlib.axes.Axes.grid does not show the parameter/keyword 'b': https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.grid.html#examples-using-matplotlib-axes-axes-grid