Skip to content

TypeError: LogScale.__init__() got an unexpected keyword argument 'ba… - #409

Open
venkataratnamb20 wants to merge 1 commit into
PySpice-org:masterfrom
venkataratnamb20:patch-1
Open

venkataratnamb20 wants to merge 1 commit into
PySpice-org:masterfrom
venkataratnamb20:patch-1

Conversation

@venkataratnamb20

Copy link
Copy Markdown

…sex' #408

Fix

Fix is to change the basex argument to base in the bode_diagram function in teh following file.

PySpice/Plot/BodeDiagram.py

####################################################################################################

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$"))

To make it easier to merge your pull request, you should divide your PR into smaller and easier-to-verify units.

Please do not make a pull requests with a lot of modifications which are difficult to check. If I merge
pull requests blindly then there is a high risk this software will become a mess quickly for everybody.

…sex' PySpice-org#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$"))

```

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant