Skip to content

Commit

Permalink
diode-characteristic-curve.py: fix TypeError: LogScale.__init__() got…
Browse files Browse the repository at this point in the history
… an unexpected keyword argument 'basey'

Error :

Traceback (most recent call last):
  File "***/PySpice/examples/diode/diode-characteristic-curve.py", line 187, in <module>
    ax2.semilogy(analysis.out, static_resistance, basey=10)
  File "***/pyspice3.11-venv/lib/python3.11/site-packages/matplotlib/axes/_axes.py", line 1958, in semilogy
    self.set_yscale('log', **d)
  File "***/pyspice3.11-venv/lib/python3.11/site-packages/matplotlib/axes/_base.py", line 73, in wrapper
    return get_method(self)(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "***/pyspice3.11-venv/lib/python3.11/site-packages/matplotlib/axis.py", line 837, in _set_axes_scale
    ax._axis_map[name]._set_scale(value, **kwargs)
  File "***/pyspice3.11-venv/lib/python3.11/site-packages/matplotlib/axis.py", line 796, in _set_scale
    self._scale = mscale.scale_factory(value, self, **kwargs)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "***/pyspice3.11-venv/lib/python3.11/site-packages/matplotlib/scale.py", line 717, in scale_factory
    return scale_cls(axis, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: LogScale.__init__() got an unexpected keyword argument 'basey'
  • Loading branch information
cyber-g committed Aug 13, 2024
1 parent dfd4c6a commit d79f275
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/diode/diode-characteristic-curve.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,8 @@ def two_scales_tick_formatter(value, position):
analysis = analyses[25]
static_resistance = -analysis.out / analysis.Vinput
dynamic_resistance = np.diff(-analysis.out) / np.diff(analysis.Vinput)
ax2.semilogy(analysis.out, static_resistance, basey=10)
ax2.semilogy(analysis.out[10:-1], dynamic_resistance[10:], basey=10)
ax2.semilogy(analysis.out, static_resistance, base=10)
ax2.semilogy(analysis.out[10:-1], dynamic_resistance[10:], base=10)
ax2.axvline(x=0, color='black')
ax2.axvline(x=silicon_forward_voltage_threshold, color='red')
ax2.axhline(y=1, color='red')
Expand Down

0 comments on commit d79f275

Please sign in to comment.