Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Z_0 label position configurable #39

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
6 changes: 5 additions & 1 deletion smithplot/smithaxes.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ class SmithAxes(Axes):
"axes.ylabel.correction": (-1, 0, 0),
"axes.radius": 0.44,
"axes.impedance": 50,
"axes.labelpos": -1-1j,
"axes.normalize": True,
"axes.normalize.label": True,
"symbol.infinity": "∞ ", # BUG: symbol gets cut off without end-space
Expand Down Expand Up @@ -304,6 +305,9 @@ def update_scParams(sc_dict=None, instance=None, filter_dict=False, reset=True,
Defines the reference impedance for normalisation.
Accepts: float

axes.labelpos: -1-1j
Position of normalization label, see axes.normalize.label

axes.normalize: True
If True, the Smith Chart is normalized to the reference impedance.
Accepts: boolean
Expand Down Expand Up @@ -466,7 +470,7 @@ def dummy(*args, **kwargs):
self.xaxis.set_major_formatter(self.RealFormatter(self))

if self._get_key("axes.normalize") and self._get_key("axes.normalize.label"):
x, y = z_to_xy(self._moebius_inv_z(-1 - 1j))
x, y = z_to_xy(self._moebius_inv_z(self._get_key("axes.labelpos")))
box = self.text(x, y, "Z$_\mathrm{0}$ = %d$\,$%s" % (self._impedance, self._get_key("symbol.ohm")), ha="left", va="bottom")

px = self._get_key("ytick.major.pad")
Expand Down