diff --git a/.gitignore b/.gitignore index 00f2f1c..da8486d 100644 --- a/.gitignore +++ b/.gitignore @@ -90,3 +90,6 @@ ENV/ # Pycharm project settings .idea + +#Mac folder information +.DS_store \ No newline at end of file diff --git a/smithplot/smithaxes.py b/smithplot/smithaxes.py index 2ed8cbb..a3a571e 100644 --- a/smithplot/smithaxes.py +++ b/smithplot/smithaxes.py @@ -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 @@ -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 @@ -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)) @@ -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") @@ -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,) @@ -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]) diff --git a/smithplot/smithhelper.py b/smithplot/smithhelper.py index cba2199..67374a7 100644 --- a/smithplot/smithhelper.py +++ b/smithplot/smithhelper.py @@ -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