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.back ends.backend_tk agg import FigureCanvasTkA gg
...
root = Tk.Tk()
...
canvas = FigureCanvasTkA gg(f, master=root)
canvas.show()
canvas.get_tk_w idget().pack(si de=Tk.TOP, fill=Tk.BOTH, expand=1)
and the scrollbar with... scrollbar = Tk.Scrollbar(ro ot, orient=Tk.HORIZ ONTAL)
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.
1 6108 bartonc 6,596
Recognized Expert Expert
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!
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: John Hunter |
last post by:
matplotlib is a 2D plotting library for python. You can use
matplotlib interactively from a python shell or IDE, or embed it in
GUI applications (WX, GTK, and Tkinter). matplotlib supports many
plot types: line plots, bar charts, log plots, images, pseudocolor
plots, legends, date plots, finance charts and more.
What's new since matplotlib 0.50
This is the first wide release in 5 months and there has been a
tremendous amount of...
|
by: scott |
last post by:
I am trying to convert a python app that uses matplotlib to a
standalone executable using py2exe.
After running py2exe and executing my app I get the following stack
trace:
Traceback (most recent call last):
File "gcToCsv.py", line 5, in ?
File "plot_output.pyc", line 1, in ?
File "pylab.pyc", line 1, in ?
|
by: fortuneteller |
last post by:
Hello,
I'm quite new to python and Scipy.
Anyway I want to use it to plot graphs.
Does anybody know if there is the possibility to use Latex in SciPy's
plotting functions like gplt?
Thanks for your help,
Matthias
|
by: John Henry |
last post by:
I've been asking this question at the matplotlib user list and never
gotten an answer. I am hoping that there are matplotlib users here
that can help.
My problem with matplotlib's way of handling axes label is illustrated
by this example:
http://www.scipy.org/Cookbook/Matplotlib/MulticoloredLine
Notice that the y-axis goes from (-1.1, 1.1) but the first label is at
|
by: Soren |
last post by:
Hi,
I'm trying to create a small GUI program where I can do plots using
Matplotlib. I've been trying to borrow code from the examples at the
matplotlib website, but I can't get it to work.
I want to be able to create a wx.Panel that contains an axis for
plotting. Around it i want other panels containing various settings,
buttons etc. to control the plot. So far I can't even get the program
to actually show a plot in a panel.
| |
by: thorstenkranz |
last post by:
Hi everyone,
I'm new here and I have a question ( I guess as everybody who is new
here ;-) ),
I'm having some strange problem with Matplotlib, using it in a Tkinter
application.
I create a Canvas, a figure, subplot and then a toolbar. It works
fine, but only without the toolbar! When I want to add the toolbar, I
|
by: vajratkarviraj |
last post by:
i hav python2.5, matplotlib0.90.1, and py2exe for python 2.5 all on windows xp... i hav a python program(letsc.py) which uses the matplotlib package... and i want 2 make an exe of it for distribution on other comps... i used py2exe... i wrote a setup.py whose contents are :
from distutils.core import setup
import py2exe
import matplotlib
setup(console=,
options={
'py2exe': {
'packages' : ,
|
by: John |
last post by:
I'm trying to install matplotlib and currently getting the below
error. I searched the group and google and couldn't find anything
similar... Any ideas?
Thanks in advance!
src/ft2font.cpp: In member function 'Py::Object
Glyph::get_path(FT_FaceRec_* const&)':
src/ft2font.cpp:441: error: 'FT_CURVE_TAG_CUBIC' was not declared in
this scope
|
by: John Henry |
last post by:
Has anybody been able to create an exe of their python applications
involving matplotlib using pyinstall (ver 1.3)? I am getting a:
RuntimeError: Could not find the matplotlib data files
when I attempt to run the exe created.
In searching the web, it appears this is an issue when others tried to
use py2exe as well. Unfortunately, the few hits I saw doesn't include
enough details to inspire me as to what I should be doing in my
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |