Skip to content

Commit

Permalink
only print warnings once in animations
Browse files Browse the repository at this point in the history
  • Loading branch information
kecnry committed Dec 12, 2019
1 parent d72b449 commit 3c12e2b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions autofig/axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1213,7 +1213,8 @@ def draw(self, ax=None, i=None, calls=None,
aspect = 'equal'
if self.pad_aspect:
if in_animation:
print("WARNING: pad_aspect not supported for animations, ignoring")
if in_animation <= 1:
print("WARNING: pad_aspect not supported for animations, ignoring")
adjustable = 'box'
else:
adjustable = 'datalim'
Expand All @@ -1227,7 +1228,7 @@ def draw(self, ax=None, i=None, calls=None,
axes_3d = isinstance(ax, Axes3D)
if not axes_3d:
ax.set_aspect(aspect=aspect, adjustable=adjustable)
elif self.equal_aspect:
elif self.equal_aspect and (not in_animation or in_animation <= 1):
print("WARNING: equal_aspect not supported for 3d axes, ignoring")

# return_calls = []
Expand Down
2 changes: 1 addition & 1 deletion autofig/mpl_animate.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def __call__(self, i):
draw_sidebars=self.draw_sidebars,
draw_title=self.draw_title,
subplot_grid=self.subplot_grid,
in_animation=True)
in_animation=i+1)

if self.animate_callback is not None:
self.animate_callback(mplfig)
Expand Down

0 comments on commit 3c12e2b

Please sign in to comment.