469,338 Members | 8,424 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,338 developers. It's quick & easy.

Controlling embeded matplotlib plots using tkinter

I'm fairly new to programming GUI's and I'm trying to control the zoom of a figure from matplotlib using a scrollbar. I can create the canvas for the figure with...


import matplotlib
import Tkinter as Tk
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
...
root = Tk.Tk()
...
canvas = FigureCanvasTkAgg(f, master=root)
canvas.show()
canvas.get_tk_widget().pack(side=Tk.TOP, fill=Tk.BOTH, expand=1)


and the scrollbar with...

scrollbar = Tk.Scrollbar(root, orient=Tk.HORIZONTAL)
scrollbar.pack(side=Tk.TOP)


I just can't seem to figure out how to get the scrollbar to interact with the figures zooming functions.

Help.
Feb 11 '07 #1
1 5599
bartonc
6,596 Expert 4TB
If you are having a hard time because the Tkinter documentation is so limited, start here. It's old, but it's what I used to learn Tkinter. That was a long time ago, so I'll have to read the docs in order to help. If that helps you get started, post back and we can fine tune your code. If not, post back and I'll post some code for you. Welcome to the Python Forum on TSDN!
Feb 11 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by John Hunter | last post: by
2 posts views Thread by scott | last post: by
8 posts views Thread by fortuneteller | last post: by
5 posts views Thread by John Henry | last post: by
1 post views Thread by thorstenkranz | last post: by
2 posts views Thread by John | last post: by
4 posts views Thread by John Henry | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by Purva khokhar | last post: by
1 post views Thread by haryvincent176 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.