From ca25beb09634cd56a98450b4d30ef2d24babd51a Mon Sep 17 00:00:00 2001 From: Venkata Ratnam Bhumireddy <58448762+venkataratnamb20@users.noreply.github.com> Date: Mon, 21 Sep 2026 18:50:50 +0530 Subject: [PATCH] TypeError: LogScale.__init__() got an unexpected keyword argument 'basex' #408 ## Fix Fix is to change the `basex` argument to `base` in the `bode_diagram` function in teh following file. [PySpice/Plot/BodeDiagram.py](https://github.com/PySpice-org/PySpice/blob/fe08718d5a1a9af94576b5aef1fa81910f09b037/PySpice/Plot/BodeDiagram.py#L57) ```python #################################################################################################### import math from matplotlib import pyplot #################################################################################################### def bode_diagram_gain(axe, frequency, gain, **kwargs): # changed `basex=10` to `base=10` axe.semilogx(frequency, gain, base=10, **kwargs) axe.grid(True) axe.grid(True, which='minor') axe.set_xlabel("Frequency [Hz]") axe.set_ylabel("Gain [dB]") #################################################################################################### def bode_diagram_phase(axe, frequency, phase, **kwargs): # changed `basex=10` to `base=10` axe.semilogx(frequency, phase, base=10, **kwargs) axe.set_ylim(-math.pi, math.pi) axe.grid(True) axe.grid(True, which='minor') axe.set_xlabel("Frequency [Hz]") axe.set_ylabel("Phase [rads]") # axe.set_yticks # Fixme: pyplot.yticks((-math.pi, -math.pi/2,0, math.pi/2, math.pi), (r"$-\pi$", r"$-\frac{\pi}{2}$", "0", r"$\frac{\pi}{2}$", r"$\pi$")) ``` --- PySpice/Plot/BodeDiagram.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PySpice/Plot/BodeDiagram.py b/PySpice/Plot/BodeDiagram.py index 5d13f566d..638c86d4c 100644 --- a/PySpice/Plot/BodeDiagram.py +++ b/PySpice/Plot/BodeDiagram.py @@ -33,7 +33,7 @@ def bode_diagram_gain(axe, frequency, gain, **kwargs): - axe.semilogx(frequency, gain, basex=10, **kwargs) + axe.semilogx(frequency, gain, base=10, **kwargs) axe.grid(True) axe.grid(True, which='minor') axe.set_xlabel("Frequency [Hz]") @@ -43,7 +43,7 @@ def bode_diagram_gain(axe, frequency, gain, **kwargs): def bode_diagram_phase(axe, frequency, phase, **kwargs): - axe.semilogx(frequency, phase, basex=10, **kwargs) + axe.semilogx(frequency, phase, base=10, **kwargs) axe.set_ylim(-math.pi, math.pi) axe.grid(True) axe.grid(True, which='minor')