Skip to content

Support derived Animate classes in order to use the same axes. #50

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

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
9 changes: 5 additions & 4 deletions spatialmath/base/graphics.py
Original file line number Diff line number Diff line change
Expand Up @@ -1462,10 +1462,11 @@ def _axes_dimensions(ax: plt.Axes) -> int:
else:
# handle the case of Animate objects pretending to be Axes
classname = ax.__class__.__name__
if classname == "Animate":
ret = 3
elif classname == "Animate2":
ret = 2
base_classes = ax.__class__.__bases__
if classname in ("Axes3DSubplot", "Animate") or any(base_class.__name__ in ("Axes3DSubplot", "Animate") for base_class in base_classes):
return 3
elif classname in ("AxesSubplot", "Animate2"):
return 2
# print("_axes_dimensions ", ax, ret)
return ret

Expand Down