471,854 Members | 1,559 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,854 software developers and data experts.

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.get_tk_widget().pack(side=Tk.TOP, fill=Tk.BOTH, expand=1)

and the scrollbar with...

scrollbar = Tk.Scrollbar(root, orient=Tk.HORIZONTAL)

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

Feb 11 '07 #1
1 5909
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
reply views Thread by aboka | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.