Skip to content

Commit 913c9b9

Browse files
committed
pass limits to plot_homline
1 parent 03c6fc7 commit 913c9b9

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

‎spatialmath/base/graphics.py‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ def plot_point(pos, marker="bs", text=None, ax=None, textargs=None, **kwargs):
176176
return handles
177177

178178

179-
def plot_homline(lines, *args, ax=None, **kwargs):
179+
def plot_homline(lines, *args, ax=None, xlim=None, ylim=None, **kwargs):
180180
"""
181181
Plot a homogeneous line using matplotlib
182182
@@ -207,8 +207,10 @@ def plot_homline(lines, *args, ax=None, **kwargs):
207207
"""
208208
ax = axes_logic(ax, 2)
209209
# get plot limits from current graph
210-
xlim = np.r_[ax.get_xlim()]
211-
ylim = np.r_[ax.get_ylim()]
210+
if xlim is None:
211+
xlim = np.r_[ax.get_xlim()]
212+
if ylim is None:
213+
ylim = np.r_[ax.get_ylim()]
212214

213215
lines = base.getmatrix(lines, (None, 3))
214216

0 commit comments

Comments
 (0)