Skip to content

Commit

Permalink
Include origin in pole zero plot #121
Browse files Browse the repository at this point in the history
  • Loading branch information
mph- committed Dec 29, 2023
1 parent 1e17019 commit 508e461
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions lcapy/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,13 @@ def plot_pole_zero(obj, xlim=None, ylim=None, **kwargs):
xlim[1] = 1
xlim[0] = xlim[0] * xscale
xlim[1] = xlim[1] * xscale

# Include origin
if xlim[0] > 0:
xlim[0] = 0
if xlim[1] < 0:
xlim[1] = 0

if len(a) >= 2:
xextra = 0.1 * (xlim[1] - xlim[0])
if xextra == 0:
Expand All @@ -177,6 +184,13 @@ def plot_pole_zero(obj, xlim=None, ylim=None, **kwargs):
ylim[1] = 1
ylim[0] = ylim[0] * yscale
ylim[1] = ylim[1] * yscale

# Include origin
if ylim[0] > 0:
ylim[0] = 0
if ylim[1] < 0:
ylim[1] = 0

if len(a) >= 2:
yextra = 0.1 * (ylim[1] - ylim[0])
if yextra == 0:
Expand Down

0 comments on commit 508e461

Please sign in to comment.