Skip to content

Commit

Permalink
Ensure linear axis scaling
Browse files Browse the repository at this point in the history
  • Loading branch information
eltos committed Mar 13, 2024
1 parent 680f33e commit 6fd1959
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions xplt/timestructure.py
Original file line number Diff line number Diff line change
Expand Up @@ -841,6 +841,10 @@ def _link_cv_duty_axes(
"""
xy = "x" if orientation[0].lower() in "xh" else "y"
ax_cv, ax_duty = (ax, at) if twin_is_duty else (at, ax)
if getattr(ax, f"get_{xy}scale")() != "linear":
raise NotImplementedError(
"Linked cv and duty axes are only supported for linear scaling!"
)

cv2duty = lambda cv: factor_duty / (1 + (cv / factor_cv) ** 2)
duty2cv = lambda du: factor_cv * (factor_duty / du - 1) ** 0.5
Expand Down

0 comments on commit 6fd1959

Please sign in to comment.