Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,6 @@ ENV/

# Pycharm project settings
.idea

#Mac folder information
.DS_store
21 changes: 11 additions & 10 deletions smithplot/smithaxes.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# last edit: 11.04.2018
# last edit: 07.22.2024
'''
Library for plotting fully automatic a Smith Chart with various customizable
parameters and well selected default values. It also provides the following
Expand Down Expand Up @@ -36,7 +36,7 @@
parameters are array-like types (e.g. numpy.ndarray).
'''

from collections import Iterable
from collections.abc import Iterable
from numbers import Number
from types import MethodType, FunctionType

Expand Down Expand Up @@ -449,18 +449,18 @@ def dummy(*args, **kwargs):
self.yaxis.get_majorticklocs()):
# workaround for fixing to small infinity symbol
if abs(loc) > self._near_inf:
tick.label.set_size(tick.label.get_size() +
tick.label1.set_size(tick.label1.get_size() +
self._get_key("symbol.infinity.correction"))

tick.label.set_verticalalignment('center')
tick.label1.set_verticalalignment('center')

x = np.real(self._moebius_z(loc * 1j))
if x < -0.1:
tick.label.set_horizontalalignment('right')
tick.label1.set_horizontalalignment('right')
elif x > 0.1:
tick.label.set_horizontalalignment('left')
tick.label1.set_horizontalalignment('left')
else:
tick.label.set_horizontalalignment('center')
tick.label1.set_horizontalalignment('center')

self.yaxis.set_major_formatter(self.ImagFormatter(self))
self.xaxis.set_major_formatter(self.RealFormatter(self))
Expand Down Expand Up @@ -507,7 +507,7 @@ def get_yaxis_transform(self, which='grid'):

def get_yaxis_text1_transform(self, pixelPad):
if hasattr(self, 'yaxis') and len(self.yaxis.majorTicks) > 0:
font_size = self.yaxis.majorTicks[0].label.get_size()
font_size = self.yaxis.majorTicks[0].label1.get_size()
else:
font_size = self._get_key("font.size")

Expand Down Expand Up @@ -728,7 +728,7 @@ def plot(self, *args, **kwargs):
pass

# if (converted) arg is an ndarray of complex type, split it
if isinstance(arg, np.ndarray) and arg.dtype in [np.complex, np.complex128]:
if isinstance(arg, np.ndarray) and arg.dtype in [complex, np.complex128]:
new_args += z_to_xy(arg)
else:
new_args += (arg,)
Expand Down Expand Up @@ -1060,8 +1060,9 @@ def draw_nonfancy(grid):
y0, y1 = yticks[k:k + 2]

x_div, y_div = d_mat[i, k]
x_div, y_div = int(x_div), int(y_div)

for xs in np.linspace(x0, x1, x_div + 1)[1:]:
for xs in np.linspace(x0, x1, int(x_div + 1))[1:]:
x_lines.append([xs, y0, y1])
x_lines.append([xs, -y1, -y0])

Expand Down
4 changes: 2 additions & 2 deletions smithplot/smithhelper.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
# last edit: 11.04.2018
# last edit: 07.22.2024

from collections import Iterable
from collections.abc import Iterable

import numpy as np

Expand Down