|
From: Benjamin R. <ben...@ou...> - 2010-12-15 14:36:34
|
On Wed, Dec 15, 2010 at 8:13 AM, Åke Kullenberg <ake...@gm...>wrote: > I am using matplotlib in a wxpython application where series are added > dynamically to subplots in a figure. I added the very handy option to toggle > series' visibility (by calling set_visible(False). The catch is however that > the invisible series are included in the rescaling of the artists (Line2D > all of them). Is there any way to fix that? The behavior I'm after is for > rescaling to be based on visible artists only. > > The way I am doing the rescaling currently is simply by calling these two > methods from the event handler: > > event.inaxes.relim() > event.inaxes.autoscale_view(tight=None, scalex=False, scaley=True) > > This might be a good feature request to make (if it hasn't already...): https://sourceforge.net/tracker/?group_id=80706 I would like to add one caveat, however. There are some cases where one would want to include the bounding boxes of the invisible artist elements in determining the axes limits. A particular use case would be animations. I believe that matplotlib would be best served by having a simple option available to let the user determine if they want to include invisible artists or not. Ben Root |