On Wed, Aug 31, 2011 at 2:55 PM, Matthew Hemke <mghe...@gmail.com> wrote:

> I have a plot canvas added to a tk interface (python 2.7.2, matplotlib
> 1.0.1) according to the recipe here:
>
>
> http://matplotlib.sourceforge.net/examples/user_interfaces/embedding_in_tk.html
>
> When the window containing the plot is resized the plot shrinks, often
> leading to REALLY ugly, unreadable plots.
>
> I tried adding scrollbars to the canvas returned by get_tk_widget() and
> they connect as expected (using the yview method). Then, I set a scrollarea
> config option for the canvas.
>
> Everything seems to be working just like a tkinter canvas, but then when
> the window is resized, the plot still resizes and the scrollbars never
> activate. I was hoping the plot wouldn't resize and the scrollbars would
> activate to allow the user to scroll to see the appropriate part of the
> plot, while still keeping the plot looking pretty.
>
> Is there a way (besides editing backend_tkagg.py self.resize method) that
> would allow the scrollbars to work properly?
>
> If my question isn't clear, I can mock up some code, but it may be a bit
> lengthy, so if anyone can steer me in a better direction that would be
> great.
>
> Thanks,
>
> -Matt
>

Matt,

Currently, (if I understand the backends and the event handling correctly),
mpl makes the assumption that a window resize event directly means a figure
resize event.  Maybe these two concepts should be decoupled to allow for
interception and handling?  I don't know how much work the mpl backends have
to do to handle the various possibilities of when to scale the figures and
when to use scrollbars.  Certainly would be quite messier than the current
assumption.

Unless I am being completely unaware of current ways to implement what you
want, I would suggest filing a feature request.  In the meantime, editing
the tk backend might be your best bet.

Cheers,
Ben Root
------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better 
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to