8000 plotvol2 more like plotvol3, doesn't require dim argument · kaigeli/spatialmath-python@8b7324e · GitHub
[go: up one dir, main page]

Skip to content

Commit 8b7324e

Browse files
committed
plotvol2 more like plotvol3, doesn't require dim argument
1 parent 721ed79 commit 8b7324e

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

spatialmath/base/graphics.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1570,7 +1570,7 @@ def axes_logic(
15701570
return ax
15711571

15721572
def plotvol2(
1573-
dim: ArrayLike,
1573+
dim: ArrayLike = None,
15741574
ax: Optional[plt.Axes] = None,
15751575
equal: Optional[bool] = True,
15761576
grid: Optional[bool] = False,
@@ -1601,10 +1601,15 @@ def plotvol2(
16011601
"""
16021602
ax = axes_logic(ax, 2, new=new)
16031603

1604-
dims = expand_dims(dim, 2)
1604+
if dim is None:
1605+
ax.autoscale(True)
1606+
else:
1607+
dims = expand_dims(dim, 2)
1608+
ax.axis(dims)
1609+
16051610
# if ax is None:
16061611
# ax = plt.subplot()
1607-
ax.axis(dims)
1612+
16081613
if labels:
16091614
ax.set_xlabel("X")
16101615
ax.set_ylabel("Y")

0 commit comments

Comments
 (0)
0