SourceForge logo
SourceForge logo
Menu

matplotlib-users — Discussion related to using matplotlib

You can subscribe to this list here.

2003 Jan
Feb
Mar
Apr
May
(3)
Jun
Jul
Aug
(12)
Sep
(12)
Oct
(56)
Nov
(65)
Dec
(37)
2004 Jan
(59)
Feb
(78)
Mar
(153)
Apr
(205)
May
(184)
Jun
(123)
Jul
(171)
Aug
(156)
Sep
(190)
Oct
(120)
Nov
(154)
Dec
(223)
2005 Jan
(184)
Feb
(267)
Mar
(214)
Apr
(286)
May
(320)
Jun
(299)
Jul
(348)
Aug
(283)
Sep
(355)
Oct
(293)
Nov
(232)
Dec
(203)
2006 Jan
(352)
Feb
(358)
Mar
(403)
Apr
(313)
May
(165)
Jun
(281)
Jul
(316)
Aug
(228)
Sep
(279)
Oct
(243)
Nov
(315)
Dec
(345)
2007 Jan
(260)
Feb
(323)
Mar
(340)
Apr
(319)
May
(290)
Jun
(296)
Jul
(221)
Aug
(292)
Sep
(242)
Oct
(248)
Nov
(242)
Dec
(332)
2008 Jan
(312)
Feb
(359)
Mar
(454)
Apr
(287)
May
(340)
Jun
(450)
Jul
(403)
Aug
(324)
Sep
(349)
Oct
(385)
Nov
(363)
Dec
(437)
2009 Jan
(500)
Feb
(301)
Mar
(409)
Apr
(486)
May
(545)
Jun
(391)
Jul
(518)
Aug
(497)
Sep
(492)
Oct
(429)
Nov
(357)
Dec
(310)
2010 Jan
(371)
Feb
(657)
Mar
(519)
Apr
(432)
May
(312)
Jun
(416)
Jul
(477)
Aug
(386)
Sep
(419)
Oct
(435)
Nov
(320)
Dec
(202)
2011 Jan
(321)
Feb
(413)
Mar
(299)
Apr
(215)
May
(284)
Jun
(203)
Jul
(207)
Aug
(314)
Sep
(321)
Oct
(259)
Nov
(347)
Dec
(209)
2012 Jan
(322)
Feb
(414)
Mar
(377)
Apr
(179)
May
(173)
Jun
(234)
Jul
(295)
Aug
(239)
Sep
(276)
Oct
(355)
Nov
(144)
Dec
(108)
2013 Jan
(170)
Feb
(89)
Mar
(204)
Apr
(133)
May
(142)
Jun
(89)
Jul
(160)
Aug
(180)
Sep
(69)
Oct
(136)
Nov
(83)
Dec
(32)
2014 Jan
(71)
Feb
(90)
Mar
(161)
Apr
(117)
May
(78)
Jun
(94)
Jul
(60)
Aug
(83)
Sep
(102)
Oct
(132)
Nov
(154)
Dec
(96)
2015 Jan
(45)
Feb
(138)
Mar
(176)
Apr
(132)
May
(119)
Jun
(124)
Jul
(77)
Aug
(31)
Sep
(34)
Oct
(22)
Nov
(23)
Dec
(9)
2016 Jan
(26)
Feb
(17)
Mar
(10)
Apr
(8)
May
(4)
Jun
(8)
Jul
(6)
Aug
(5)
Sep
(9)
Oct
(4)
Nov
Dec
2017 Jan
(5)
Feb
(7)
Mar
(1)
Apr
(5)
May
Jun
(3)
Jul
(6)
Aug
(1)
Sep
Oct
(2)
Nov
(1)
Dec
2018 Jan
Feb
Mar
Apr
(1)
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
2020 Jan
Feb
Mar
Apr
May
(1)
Jun
Jul
Aug
Sep
Oct
Nov
Dec
2025 Jan
(1)
Feb
Mar
Apr
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
S M T W T F S




1
(3)
2
(9)
3
(4)
4
(1)
5
6
(5)
7
(8)
8
(11)
9
(15)
10
(5)
11
(2)
12
13
(7)
14
(4)
15
(13)
16
(6)
17
(1)
18
19
(16)
20
(10)
21
(13)
22
(13)
23
(3)
24
(1)
25
(3)
26
(4)
27
(1)
28
(6)
29
(6)
30
(1)
31

Showing results of 166

<< < 1 2 3 4 5 .. 7 > >> (Page 3 of 7)
From: Vineet J. <vi...@al...> - 2004年07月21日 04:15:37
Thanks for the information. It has been very helpful. Matplotlib seems to be
ignoring the use command. When I change the value in .matplotlibrc it works
however adding the use('Agg') does not change the backed. Do I need to do
anything else?
Thanks,
Vineet
-----Original Message-----
From: mat...@li...
[mailto:mat...@li...]On Behalf Of John
Hunter
Sent: Tuesday, July 20, 2004 9:15 AM
To: Vineet Jain
Cc: mat...@li...
Subject: Re: [Matplotlib-users] How to run matplotlib in batch mode to
generate plot image files
>>>>> "Vineet" == Vineet Jain <vi...@al...> writes:
 Vineet> 1. I added the following at the end of the script just
 Vineet> before show savefig("filename")
 Vineet> It works however the intereactive mode still comes up. How
 Vineet> can I generate the image file without having the
 Vineet> interactive window come up.
Hi Vineet,
This is because you are using the TkAgg backend. This is the default
backend for win32 users. You set the default backend in your
.matplotlibrc file, which is located in
C:\python23\share\matplotlib\.matplotlibrc for a standard win32
install. For pure image generation, you probably want to choose Agg
as the default backend. There are a number of ways of setting the
backend at runtime, as described at
http://matplotlib.sourceforge.net/backends.html
 Vineet> 2. figure(1, facecolor=figBG) What is this used for? Is it
 Vineet> for the interactive charting? I can still generate charts
 Vineet> to file with this commented.
Here is a little background. You can use the functions figure,
subplot, and axes to explicitly control this figure and axes creation.
If you don't use them, defaults will be issued for you. Let's take a
look at what happens under the hood when you issue the commands
 >>> from matplotlib.matlab import *
 >>> plot([1,2,3])
When plot is called, the matlab interface makes a call to gca() "get
current axes" to get a reference to the current axes. gca in turn,
makes a call to gcf() to get a reference to the current figure. gcf,
finding that no figure has been created, creates the default figure
with figure() and returns it. gca will then return the current axes
of that figure if it exists, or create the default axes
subplot(111) if it does not. Thus the code above is equivalent
to
 >>> from matplotlib.matlab import *
 >>> figure()
 >>> subplot(111)
 >>> plot([1,2,3])
The only time you need to manually call figure, subplot and axes are
when 1) you want to manage multiple figures and axes, or 2) you want
to change the default parameters (sizes, locations, colors, etc).
 Vineet> 3. Where and how do you set the overall size of the chart
 Vineet> ( in inches or pixels)
The figsize kwarg to figure sets the figure size in inches. The dpi
specifies the dots per inch. The figure width in pixels is thus the
figsize width component time the dpi. You can set these as kwargs to
the figure command - see
http://matplotlib.sf.net/matplotlib.matlab.html#-figure or by setting
the defaults in your rc file in the section
 ### FIGURE
 figure.figsize : 8, 6 # figure size in inches
 figure.dpi : 80 # figure dots per inch
 figure.facecolor : 0.75 # figure facecolor; 0.75 is scalar gray
 figure.edgecolor : w # figure edgecolor; w is white
Note that the rc allows different defaults for savefig, which are
given by
 savefig.dpi : 100 # figure dots per inch
 savefig.facecolor : w # figure facecolor; 0.75 is scalar gray
 savefig.edgecolor : w # figure edgecolor; w is white
Cheers,
JDH
-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click
_______________________________________________
Matplotlib-users mailing list
Mat...@li...
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Curtis C. <cu...@hi...> - 2004年07月20日 18:58:48
Hi all,
I have a fix for the problem mentioned. In the latest release, subdir
matploblib-0.60.2/matplotlib/matlab.py line 542 there is a bug. It should
read:
cax.set_yticklabels([tickfmt%tick for tick in cticks])
instead of
cax.set_yticklabels(['%1.1f'%tick for tick in cticks])
so as to take advantage of the optional input parameter tickfmt (format
specifier) for the colorbar labels. With this change, the colorbar labels
come out fine and adjust properly according to the input format specifier.
Thanks,
Curtis
From: John H. <jdh...@ac...> - 2004年07月20日 14:49:18
>>>>> "Malte" =3D=3D Malte Marquarding <Mal...@cs...> write=
s:
 Malte> Hi, I am trying to use a script interacively. It basically
 Malte> needs to do the following.
 Malte> * do some work * plot() * Ask whether to keep the data
 Malte> plotted or not etc.
 Malte> This should be done (initially) at the command line using
 Malte> raw_read(). I don't want to close the plot window to get
 Malte> back to the prompt. In terms of a GUI this would be easy
 Malte> as the dialog would run in the same thread as the plot
 Malte> window. But interactive.py doesn't seem to be the
 Malte> solution.
The best solution for interactive plots is to use the tkagg backend
with interactive set to True in your rc file. Use a standard python
shell or better yet, ipython. Ie, your rc file should have the
settings
backend : TkAgg # the default backend
interactive : True =20
You can then plot interactively from the shell, and get your prompt
back after each command. Fernando Perez has made some preliminary
extensions for ipython to support interactive use of matplotlib for
TkAgg and may be making an extension for GTKAgg. Very nice for
interactive use. Available from
 http://ipython.scipy.org/
For the 'pylab' extensiosn, save the two files included at the end of
this email to your ~/.ipython dir and start ipython with
 > ipython -p pylab
 Malte> BTW, I am running 0.54.2 as I can't get 0.60.2 to compile
 Malte> under debian stable.
Please build with=20
 > python setup.py build > build.out=20
and post the results to the matplotlib-devel list.
Cheers,
JDH
### begin pylab
# -*- Mode: Shell-Script -*- Not really, but it shows comments correctly
#************************************************************************=
***
# Configuration file for ipython -- ipythonrc format
#
# The format of this file is one of 'key value' lines.
# Lines containing only whitespace at the beginning and then a # are igno=
red
# as comments. But comments can NOT be put on lines with data.
#************************************************************************=
***
# If this file is found in the user's ~/.ipython directory as ipythonrc-p=
ylab,
# it can be loaded by calling passing the '-profile pylab' (or '-p pylab'=
)
# option to IPython.
# This profile load modules which turn IPython into a very capable enviro=
nment
# for numerical work, as compatible with Matlab as possible.
# Load the user's basic configuration
include ipythonrc
# Load all additional matlab-like functionality from Numeric and matplotl=
ib
execfile matplotlib_load.py
### end pylab
### begin matplotlib_load.py
# -*- coding: iso-8859-1 -*-
"""matlab-like functionality based on matplotlib and Numeric's MLab.
Load these modules and configure them for interactive use"""
#************************************************************************=
*****
# Copyright (C) 2004 Fernando P=C3=A9rez. <fp...@co...>
#
# Distributed under the terms of the GNU Lesser General Public License (=
LGPL)
#
# This code is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# The full text of the LGPL is available at:
#
# http://www.gnu.org/copyleft/lesser.html
#************************************************************************=
*****
__author__ =3D 'Fernando P=C3=A9rez. <fp...@co...>'
__license__=3D 'LGPL'
# Set matplotlib in interactive mode with the TkAgg backend
# THESE MUST BE THE FIRST MATPLOTLIB COMMANDS CALLED!
import matplotlib
matplotlib.use('TkAgg')
matplotlib.interactive(True)
# Now we can continue...
# Load these by themselves so that 'help MODULE' works
import matplotlib.matlab as matlab
# MA (MaskedArray) modifies the Numeric printing mechanism so that huge a=
rrays
# are only summarized and not printed (which could freeze the machine for=
 a
# _long_ time).
import MA
# Bring all of the numeric and plotting commands to the toplevel namespac=
e
from IPython.numutils import *
from matplotlib.matlab import *
print """Welcome to pylab, a matlab-like python environment.
 help(Numeric) -> help on NumPy, Python's basic numerical library.
 help(matlab) -> help on matlab compatible commands from matplotlib.
 help(plotting) -> help on plotting commands.
 """
### end matplotlib_load.py
From: John H. <jdh...@ac...> - 2004年07月20日 14:38:54
>>>>> "Vineet" == Vineet Jain <vi...@al...> writes:
 Vineet> 1. I added the following at the end of the script just
 Vineet> before show savefig("filename")
 Vineet> It works however the intereactive mode still comes up. How
 Vineet> can I generate the image file without having the
 Vineet> interactive window come up.
Hi Vineet,
This is because you are using the TkAgg backend. This is the default
backend for win32 users. You set the default backend in your
.matplotlibrc file, which is located in
C:\python23\share\matplotlib\.matplotlibrc for a standard win32
install. For pure image generation, you probably want to choose Agg
as the default backend. There are a number of ways of setting the
backend at runtime, as described at
http://matplotlib.sourceforge.net/backends.html
 Vineet> 2. figure(1, facecolor=figBG) What is this used for? Is it
 Vineet> for the interactive charting? I can still generate charts
 Vineet> to file with this commented.
Here is a little background. You can use the functions figure,
subplot, and axes to explicitly control this figure and axes creation.
If you don't use them, defaults will be issued for you. Let's take a
look at what happens under the hood when you issue the commands
 >>> from matplotlib.matlab import *
 >>> plot([1,2,3])
When plot is called, the matlab interface makes a call to gca() "get
current axes" to get a reference to the current axes. gca in turn,
makes a call to gcf() to get a reference to the current figure. gcf,
finding that no figure has been created, creates the default figure
with figure() and returns it. gca will then return the current axes
of that figure if it exists, or create the default axes
subplot(111) if it does not. Thus the code above is equivalent
to
 >>> from matplotlib.matlab import *
 >>> figure()
 >>> subplot(111)
 >>> plot([1,2,3])
The only time you need to manually call figure, subplot and axes are
when 1) you want to manage multiple figures and axes, or 2) you want
to change the default parameters (sizes, locations, colors, etc).
 Vineet> 3. Where and how do you set the overall size of the chart
 Vineet> ( in inches or pixels)
The figsize kwarg to figure sets the figure size in inches. The dpi
specifies the dots per inch. The figure width in pixels is thus the
figsize width component time the dpi. You can set these as kwargs to
the figure command - see
http://matplotlib.sf.net/matplotlib.matlab.html#-figure or by setting
the defaults in your rc file in the section
 ### FIGURE
 figure.figsize : 8, 6 # figure size in inches
 figure.dpi : 80 # figure dots per inch
 figure.facecolor : 0.75 # figure facecolor; 0.75 is scalar gray
 figure.edgecolor : w # figure edgecolor; w is white
Note that the rc allows different defaults for savefig, which are
given by
 savefig.dpi : 100 # figure dots per inch
 savefig.facecolor : w # figure facecolor; 0.75 is scalar gray
 savefig.edgecolor : w # figure edgecolor; w is white
Cheers,
JDH
From: John H. <jdh...@ac...> - 2004年07月20日 14:27:55
>>>>> "Darren" == Darren Dale <dd...@co...> writes:
 Darren> Hi everyone, Now that I have become an intermediate python
 Darren> programmer, I want to learn how to build some GUIs. I am
 Darren> trying to decide between WX and GTK, and was hoping to get
 Darren> input from this list specifically.
There is some information here -
http://matplotlib.sourceforge.net/faq.html#WHICHBACKEND
Here's my 2c
Use a *Agg backend, either TkAgg, WXAgg or GTKAgg. This way you'll
always be assured of having the most complete feature set. All
produce identical figures since they use Agg.
Of those three, there are tradeoffs.
GTK
 A great choice if your deploying on linux and win32 only. A word of
 caution thought: win32 support is becoming more problematic now that
 dropline gtk runtime installers are no longer supported. OS X is
 more difficult unless your users use fink. Steve Chaplin maintains
 the GTK backend and is very active keeping the code consistent with
 different pygtk releases etc. The application I develop with
 matplotlib uses GTKAgg, so yes, developer support is good. I
 primarily develop this application on linux and deploy on win32 (all
 my users only know windows) and it has been quite successful and
 non-problematic. GTKAgg is also currently the fastest backend for
 dynamic (animated) images.
 
Tk
 A good choice if you want the greatest likelihood of it working
 across all platforms with minimal extra dependencies. Excellent
 support from Todd Miller and stsci. The only two downsides, in my
 opinion, are 1) that the widgets aren't so nice and 2) TkAgg is a
 bit slow (1.5-3x slower than GTKAgg) for dynamic images because the
 transfer from agg to the tk canvas is slow - this is mostly out of
 our control.
WX
 As you noted a very popular platform, native widgets, etc. Can be a
 tough install on OS X and linux, but works great for win32 (eg
 enthought edition). Support is a problem with no active maintainer,
 though I do what I can. If you use WXAgg, support is less of a
 problem since the widget interface is fairly stable. If you need
 dynamic images, this will currently be slower than GTKAgg since I
 use string methods to transfer the agg image buffer to the wx
 canvas, but at some point I would like to write some wx extension
 code for this purpose. A number of people with good knowledge of
 matplotlib internals use wx for application development and I think
 are fairly satisfied.
FLTK
 Gregory Lielens has developed a FLTK backend, though it is not yet
 in CVS. Early reports are that it is quite fast, as we would hope,
 from the name.
JDH
 
From: John H. <jdh...@ac...> - 2004年07月20日 14:08:19
>>>>> "Stephen" == Stephen Walton <ste...@cs...> writes:
 Stephen> On Mon, 2004年07月19日 at 10:28, John Hunter wrote:
 >> As for resetting the axes to the original view, redraw would
 >> not have done that. In the next generation toolbar, I might be
 >> able to add a button to support that. It already has a forward
 >> / back button to navigate between previous views.
 Stephen> Er, it does? I don't see them, at least not with either
 Stephen> the default backend on FC1, which I'm guessing is GTK,
 Stephen> nor with the TkAgg one.
Sorry for the confusion - when I sat "it already has...", I'm
referring to the next generation toolbar that is under development in
CVS. Only GTK and GTKAgg have a prototype version of the new toolbar
in CVS. 
For the record, the default backend in the src distributions (*.tar.gz
and *.zip) is GTKAgg. For win32, the default backend in TkAgg.
 Stephen> Incidentally, the on line .matplotlibrc example file
 Stephen> still has the "toolbar" keyword, which is gone, and is
 Stephen> missing the "datapath" one.
Which rc file are you referring to? There is no reference to the
toolbar option in the 0.60.2 release, though it is in CVS and on the
web (should fix that one, though it is listed as experimental). The
datapath was intentionally omitted - it exists for those who want use
it to set the data path but for most users the default is OK. I just
changed this in my dev tree to include a commented out reference to it
to alert users that it is there.
Thanks,
JDH
From: Wilson, G. <gre...@hp...> - 2004年07月20日 13:59:09
Hi everyone. Hope you don't mind mail out of the blue,
but I've just discovered matplotlib, and am hoping
to use it to plot some time series data (progress
of our project over time). One thing I can't seem
to find is a way to control the format and content
of the tick labels on the X and Y axes. The data I
have is monthly from 1999 to the present, so I'd like
to set X tick labels to be "1999-Jan", "-Feb", and so
on. I tried following the link in the tutorial to
"figure.html#Axes", but it 404'd, and my experiments
using "set(gca(), 'xticklabels', [...stuff...])" are
not doing what I'd hoped.
Similarly, the Y data runs from -600 to about +24,000
(yes, some months we go backward ;-). Right now,
matplotlib is switching to scientific notation when it
hits 1.000e+04 (10,000). Any hints?
Thanks,
Greg Wilson
Hewlett-Packard=20
From: Arnd B. <arn...@we...> - 2004年07月20日 11:03:39
On 2004年7月19日, John Hunter wrote:
> >>>>> "Arnd" == Arnd Baecker <arn...@we...> writes:
[...]
> Arnd> 1) I would like to know if there is an equivalent to the
> Arnd> scipy.xplt.mouse command which (in its simplest form) waits
> Arnd> for a mouse click and returns its coordinates:
>
> Arnd> Example: #------------------------------------- from
> Arnd> scipy.xplt import * x=arange(0.0,1.0,0.1) plg(x*x,x)
> Arnd> m=mouse(1,-1,"click with the mouse") print "x,y=",m[0],m[1]
> Arnd> #-------------------------------------
[...]
>
> For some time, we've provided basic cross GUI event handling with the
> canvas.connect method. Todd Miller had the idea to port the gtk
> connect interface to Tk. For example, the demo coords_demo.py runs
> unchanged on TkAgg and GTKAgg. This is only a partial implementation,
> and in CVS I've extended it a bit more. The new method is called
> mpl_connect, and you will be able to do, across GUIs, calls like
>
> def on_move(event):
> # get the x and y coords
> x, y = event.x, event.y
> ...snip...
>
> canvas.mpl_connect('motion_notify_event', on_move)
>
>
> I plan to provide the motion notify, on click, and key press events,
> and provide some extra positional information in the events, namely
> canvas coordinate location and axes coordinate location. The backend
> will handle things like flipy so the script can ignore it. I'm in the
> process of designing a better toolbar and am using this cross-GUI
> event handling to minimize the burden of implementing the toolbar in
> the various backends.
>
> In order to do something like the
>
> m = mouse(1,-1,"click with the mouse")
> print "x,y=",m[0],m[1]
>
> example, it would be necessary to implement some cross gui blocking
> capability, so that the execution of the script is halted until the
> block is removed. I don't see this as a major problem, but will
> require some input from people with experience on the not-GTK GUIs.
> It's probably not be necessary, though, since it's only a few more
> keystrokes to do
>
> def on_click(event): print 'x, y =', event.x, event.y
> canvas.mpl_connect(''button_press_event', on_click)
>
> This should be ready by the 0.61 release.
Excellent - that sounds really good!
Still I think that maybe the variant with blocking is
useful as well: I am having our students in mind
which were quite happy and sucessfull with scipy.xplt
(in particular also those who had no previous programming
experience.) Introducing them to event driven ``design''
already in the second excercise might be burdoning them
too much (but maybe I am wrong).
> BTW, as a wx expert,
> perhaps you have a code snippet I can use which calls the event
> Connect and Disconnect methods directly. I'm currently trying to
> figure this out for the wx implementation of mpl_connect and
> mpl_disconnect.
I am definitively no wx expert - a lot of the stuff I learned
from looking at Chris Barker's and Gordon Williams' code
and the wxPython demo. So I also don't have an example here.
(It only rings a bell that Chris maybe had some discussion
on this on the wxPython mailing list - I think it
was about creating custom events - maybe
there is an example in Chris' FloatCanvas?
Ok, I just had a _quick_ look and at the beginning
of FloatCanvas.py
( http://home.comcast.net/~chrishbarker/FloatCanvas/ )
there are a couple of window.Connect.
Maybe this helps...
Anyway, if you did not succeed by Friday let me know
and I will try to have a look over the week-end.
> Arnd> 2) For one set of applications I would like to be able to
> Arnd> plot several times 1000 points (or more). Optimally would
> Arnd> be to plot one point after another to get a dynamical
> Arnd> impression. In the application I have in mind there would
> Arnd> be no need to store these points (ie zooming is not
> Arnd> necessary) which normally degrades performance. Presently
> Arnd> for me the solution for this type of things is our
> Arnd> PlottingCanvas for wxPython, see
> Arnd> http://www.physik.tu-dresden.de/~baecker/python/plot.html
> Arnd> and there the StandardMap.py example.
>
> There is a lot of interest in making dynamical plotting more
> efficient. Currently, the entire figure is redrawn with each frame
> update, which is clearly not ideal for dynamic figures in which only a
> portion needs to be redrawn. I'm interested in making some changes to
> better support "real time" data acquisition, where the quotes mean
> "fast enough to handle most use cases".
Personally I am a bit sceptic, if it is possible to
cater for all needs (super-fast vs. zooming/redraw of stored data, ...),
sureley not at the same time but maybe a
reasonable comprise is possible ;-).
> My current thought is to support drawing to subsections of the agg
> canvas, eg, so that a single axes, line or patch could be updated
> without updating the entire figure canvas. To support this, each
> object would need to know it's rectangular extent (done), take a
> snapshot of the background canvas before drawing (to be done) and know
> how to render itself to canvas (done). In addition, agg and the
> backends would need to be extended to allow drawing of subregions of
> the canvas, which should be fairly easy. By calling the right
> combination of store_background, draw and erase, you could get much
> faster dynamic plots.
Thinking of the example I have in mind, where not untypically
up to 100 x 10000 points are plotted (or even more)
storing each point as an object + further information
might (presumably will) slow things down and cause memory problems
(that's what occurred for me with Tkinter).
Anyway, in September we have a student who will
set up a couple of examples and then we will see
if things are fast enough (for us ;-)...
> The current implementation (redrawing the entire figure) is pretty
> fast on a fast machine, but needs to be faster.
>
> How do you do this in PlottingCanvas? Do simply add objects to the
> canvas
Yes (with the usual double-buffering)
so for example for a circle we just call
 self.ScreenDC.DrawCircle(x, y, pointsize)
 self.BufferDC.DrawCircle(x, y, pointsize)
and the border color and fill color of the circle are
initialized before and only once for a sequence of successive points.
Also (in the case of wx) it helps a lot if the
drawing context (DC) is only initialized once
for a sequence of successive points.
Nikolai (Hlubek) measured the speed increase to be
 factor 2 for wx.wxClientDC(self)
 factor 10 for wx.wxBufferedDC(wx.wxClientDC(self), self._Buffer)
> and redraw the entire canvas if you need to remove an object,
Well, in the fastest mode of operation we don't
allow for removal of objects/resizing the canvas and things like that...
> or do you support selective erasing and removal of objects?
No. What the PlottingCanvas does provide though
is the possibility to ``move'' an object over
a ``background'' plot - see AnnularBilliard.py
where a ball is moving inside a two-dimensional billiard
(click in the right window to specify the initial condition
and move the slider upwards to increas the speed of
the ball a bit).
In another mode of operation we enable storing
of all data points (with the corresponding speed penalty).
This then allows to zoom in and redraw those data.
Despite some optimizations, plotting with wx
is still not as fast as for example with pgplot
(wherever the bottlenecks are ;-).
Best,
Arnd
From: Arnd B. <arn...@we...> - 2004年07月20日 09:57:58
On 2004年7月19日, Malte Marquarding wrote:
> I have sarge (with a few unstable bits and pieces)
> It 'shouldn't' be dependent on "unstable".
>
> You can always see what extra libs it wants and decide then if you wnat
> it or not.
>
> Cheers,
> Malte.
Indeed it works without any problems - the only
additional requirement from http://mentors.debian.net/
was python-ttfquery_1.0.0_all.deb
(it also requested
fonttools, python-gd python2.3-xml libgd2-xpm libgd-tools,
all available in testing.)
Many thanks,
Arnd
> Arnd Baecker wrote:
>
> >
> >
> >Before I screw up my installation ;-)
> > - did anyone successfully use these on sarge (debian testing)?
> > - and/or are there deb's available for sarge?
> >
> >Many thanks,
> >
> >Arnd
> >
> >
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by BEA Weblogic Workshop
> FREE Java Enterprise J2EE developer tools!
> Get your free copy of BEA WebLogic Workshop 8.1 today.
> http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Malte M. <Mal...@cs...> - 2004年07月20日 05:39:57
Hi,
I am trying to use a script interacively. It basically needs to do the 
following.
* do some work
* plot()
* Ask whether to keep the data plotted or not
etc.
This should be done (initially) at the command line using raw_read().
I don't want to close the plot window to get back to the prompt.
In terms of a GUI this would be easy as the dialog would run in the same 
thread as the plot window.
But interactive.py doesn't seem to be the solution.
BTW, I am running 0.54.2 as I can't get 0.60.2 to compile under debian 
stable.
From: Vineet J. <vi...@al...> - 2004年07月20日 03:39:47
1. I added the following at the end of the script just before show
savefig("filename")
It works however the intereactive mode still comes up. How can I generate
the image file without having the interactive window come up.
2. figure(1, facecolor=figBG)
What is this used for? Is it for the interactive charting? I can still
generate charts to file with this commented.
3. Where and how do you set the overall size of the chart ( in inches or
pixels)
Thanks,
Vineet
From: Stephen R. <snr...@ya...> - 2004年07月19日 21:23:21
There is a backend from wx to maplotlib, along with GTK and TKinter 
also. I'm just recently started using matplotlib and wx. Seems to work 
fine - though not very fast for what we're trying to do (multiple 
graphs on screen, updated at a fixed multi-Hz rate). Having said that, 
matplotilb does a decent job and the feedback and turnaround on its 
mailing list is great. I haven't delved far into wx yet, but for the 
most part its decent with pretty good documentation.
HTH
Stephen
On Jul 19, 2004, at 4:59 PM, Uwe Schmitt wrote:
>>
>> Hi everyone,
>
> Hi Darren,
>
>>
>> Now that I have become an intermediate python programmer, I want to
>> learn how to build some GUIs. I am trying to decide between WX and 
>> GTK,
>> and was hoping to get input from this list specifically.
>>
>
> wxPython wraps wxWidgets which wraps GTK on Unix machines.
>
> From wxwidgets.com:
> "wxWidgets gives you a single, easy-to-use API for writing GUI
> applications
> on multiple platforms. Link with the appropriate library for your 
> platform
> (Windows/Unix/Mac, others coming shortly) and compiler (almost any 
> popular
> C++ compiler),
> and your application will adopt the look and feel appropriate to that
> platform. "
>
> So you get cross platform support for free. I had a look at pyQt which 
> looks
> very promising, but has some limitations if you want to sell pyQT
> applications
> for windows machines.
>
> There is a package called PythonCard (http://pythoncard.sf.net) which 
> is
> a layer above wxPython. PythoCard simpliefies programming simple GUIs,
> but is restricted in its functionality.
>
> wxPython is my workorse for GUI programming for some years now and
> I'm quite happy with it. The mailing list is friendly and helpfull, 
> too.
>
> According to http://matplotlib.sf.net there is a wx backend, but I 
> never
> used it.
>
> Greetings, Uwe.
From: Uwe S. <sc...@nu...> - 2004年07月19日 20:56:32
>
> Hi everyone,
Hi Darren,
>
> Now that I have become an intermediate python programmer, I want to
> learn how to build some GUIs. I am trying to decide between WX and GTK,
> and was hoping to get input from this list specifically.
>
wxPython wraps wxWidgets which wraps GTK on Unix machines.
From wxwidgets.com:
 "wxWidgets gives you a single, easy-to-use API for writing GUI
applications
 on multiple platforms. Link with the appropriate library for your platform
 (Windows/Unix/Mac, others coming shortly) and compiler (almost any popular
C++ compiler),
 and your application will adopt the look and feel appropriate to that
platform. "
So you get cross platform support for free. I had a look at pyQt which looks
very promising, but has some limitations if you want to sell pyQT
applications
for windows machines.
There is a package called PythonCard (http://pythoncard.sf.net) which is
a layer above wxPython. PythoCard simpliefies programming simple GUIs,
but is restricted in its functionality.
wxPython is my workorse for GUI programming for some years now and
I'm quite happy with it. The mailing list is friendly and helpfull, too.
According to http://matplotlib.sf.net there is a wx backend, but I never
used it.
Greetings, Uwe.
>
From: Stephen W. <ste...@cs...> - 2004年07月19日 20:56:17
On Mon, 2004年07月19日 at 10:28, John Hunter wrote:
> As for
> resetting the axes to the original view, redraw would not have done
> that. In the next generation toolbar, I might be able to add a button
> to support that. It already has a forward / back button to navigate
> between previous views.
Er, it does? I don't see them, at least not with either the default
backend on FC1, which I'm guessing is GTK, nor with the TkAgg one.
Incidentally, the on line .matplotlibrc example file still has the
"toolbar" keyword, which is gone, and is missing the "datapath" one.
-- 
Stephen Walton <ste...@cs...>
Dept. of Physics & Astronomy, Cal State Northridge
From: Darren D. <dd...@co...> - 2004年07月19日 18:25:36
Attachments: dd55.vcf
Hi everyone,
Now that I have become an intermediate python programmer, I want to 
learn how to build some GUIs. I am trying to decide between WX and GTK, 
and was hoping to get input from this list specifically.
GTK seems to have the most active support in matplotlib. Is this true? 
The amount of demo code for learning pygtk is not as good as for 
wxPython, for example, I cant figure out how to call a print dialog with 
gtk. Does one exist?
WX seems to have the most broad support in the Python community. WX 
seems easier to work with based on the demo code, but once I graduate 
and make the switch to Linux, it seems a waste to be interfacing GTK 
through wxPython. WX needs another person to help with maintanence, and 
I want to help with Matplotlib when I become experienced enough to be of 
use to the project. But for now, I need to be able to analyze data and 
finish school.
While undecided on a GUI, I am decided on python and matplotlib, so your 
input would be valuable. Right now I don't have enough experience to 
make an intelligent decision.
Thanks in advance,
Darren
-- 
Darren S. Dale
dd...@co...
PGP public key available
From: Curtis C. <cu...@hi...> - 2004年07月19日 18:12:50
Hi,
I have been using the colorbar() method along with pcolor to make image
plots of data. Normally, the colorbar legend is correct. However, when
the range of numbers to plot is less than 1, such as 10^-3 - 2*10^-3, the
colorbar labels just show up as 0.0 on the top and bottom.
Thanks,
Curtis
From: John H. <jdh...@ac...> - 2004年07月19日 17:52:27
>>>>> "Stephen" == Stephen Walton <ste...@cs...> writes:
 Stephen> I have played with version 0.50 a bit before, but I asked
 Stephen> about the "missing" widgets because they're still in the
 Stephen> online tutorial. Plus, I had thought the redraw button
 Stephen> would be a convenient way to reset a plot to its default
 Stephen> after zooming and/or scrolling in one or the other axis.
 Stephen> This last function is one I actually need, but I was
 Stephen> unable to see anywhere in the documentation how it might
 Stephen> be done.
Thanks for letting me know about the tutorial problem. As for
resetting the axes to the original view, redraw would not have done
that. In the next generation toolbar, I might be able to add a button
to support that. It already has a forward / back button to navigate
between previous views. By clicking back enough times, you'll get
back to your original view. Still, if you are deep enough in, a
"reset" button might be nice.
 Stephen> This turned out to be SOE (Stupid Operator Error). I
 Stephen> didn't have the tk-devel and tcl-devel packages
 Stephen> installed. Unfortunately the lack of tk.h and/or tcl.h
 Stephen> causes so many error messages in the compile that the
 Stephen> line complaining about their lack is easy to miss. Not a
 Stephen> matplotlib problem, I hasten to add.
Yep, you have to train yourself to find that first error, the rest are
often meaningless.
JDH
From: John H. <jdh...@ac...> - 2004年07月19日 17:48:24
>>>>> "Arnd" == Arnd Baecker <arn...@we...> writes:
 Arnd> Hi, I am following this mailing list for a while now and
 Arnd> considering to convert to matplotlib at some point. Whether
 Arnd> this is feasable depends on the following two points:
 Arnd> 1) I would like to know if there is an equivalent to the
 Arnd> scipy.xplt.mouse command which (in its simplest form) waits
 Arnd> for a mouse click and returns its coordinates:
 Arnd> Example: #------------------------------------- from
 Arnd> scipy.xplt import * x=arange(0.0,1.0,0.1) plg(x*x,x)
 Arnd> m=mouse(1,-1,"click with the mouse") print "x,y=",m[0],m[1]
 Arnd> #-------------------------------------
 Arnd> John's reply
 Arnd> http://mail.python.org/pipermail/python-list/2004-April/216550.html
 Arnd> shows that it is possible to connect mouse events with
 Arnd> functions. However, that code depends on the back-end and
 Arnd> is not as short as the above one (though more flexible, of
 Arnd> course ;-).
For some time, we've provided basic cross GUI event handling with the
canvas.connect method. Todd Miller had the idea to port the gtk
connect interface to Tk. For example, the demo coords_demo.py runs
unchanged on TkAgg and GTKAgg. This is only a partial implementation,
and in CVS I've extended it a bit more. The new method is called
mpl_connect, and you will be able to do, across GUIs, calls like
def on_move(event):
 # get the x and y coords
 x, y = event.x, event.y
 ...snip...
canvas.mpl_connect('motion_notify_event', on_move)
I plan to provide the motion notify, on click, and key press events,
and provide some extra positional information in the events, namely
canvas coordinate location and axes coordinate location. The backend
will handle things like flipy so the script can ignore it. I'm in the
process of designing a better toolbar and am using this cross-GUI
event handling to minimize the burden of implementing the toolbar in
the various backends.
In order to do something like the 
 m = mouse(1,-1,"click with the mouse") 
 print "x,y=",m[0],m[1]
example, it would be necessary to implement some cross gui blocking
capability, so that the execution of the script is halted until the
block is removed. I don't see this as a major problem, but will
require some input from people with experience on the not-GTK GUIs.
It's probably not be necessary, though, since it's only a few more
keystrokes to do
def on_click(event): print 'x, y =', event.x, event.y
canvas.mpl_connect(''button_press_event', on_click)
This should be ready by the 0.61 release. BTW, as a wx expert,
perhaps you have a code snippet I can use which calls the event
Connect and Disconnect methods directly. I'm currently trying to
figure this out for the wx implementation of mpl_connect and
mpl_disconnect.
 Arnd> 2) For one set of applications I would like to be able to
 Arnd> plot several times 1000 points (or more). Optimally would
 Arnd> be to plot one point after another to get a dynamical
 Arnd> impression. In the application I have in mind there would
 Arnd> be no need to store these points (ie zooming is not
 Arnd> necessary) which normally degrades performance. Presently
 Arnd> for me the solution for this type of things is our
 Arnd> PlottingCanvas for wxPython, see
 Arnd> http://www.physik.tu-dresden.de/~baecker/python/plot.html
 Arnd> and there the StandardMap.py example.
There is a lot of interest in making dynamical plotting more
efficient. Currently, the entire figure is redrawn with each frame
update, which is clearly not ideal for dynamic figures in which only a
portion needs to be redrawn. I'm interested in making some changes to
better support "real time" data acquisition, where the quotes mean
"fast enough to handle most use cases".
My current thought is to support drawing to subsections of the agg
canvas, eg, so that a single axes, line or patch could be updated
without updating the entire figure canvas. To support this, each
object would need to know it's rectangular extent (done), take a
snapshot of the background canvas before drawing (to be done) and know
how to render itself to canvas (done). In addition, agg and the
backends would need to be extended to allow drawing of subregions of
the canvas, which should be fairly easy. By calling the right
combination of store_background, draw and erase, you could get much
faster dynamic plots.
The current implementation (redrawing the entire figure) is pretty
fast on a fast machine, but needs to be faster.
How do you do this in PlottingCanvas? Do simply add objects to the
canvas and redraw the entire canvas if you need to remove an object,
or do you support selective erasing and removal of objects?
JDH
From: Stephen W. <ste...@cs...> - 2004年07月19日 16:41:53
On Mon, 2004年07月19日 at 08:24, John Hunter wrote:
> >>>>> "GStephen" == Stephen Walton <ste...@cs...> writes:
>
> GStephen> I am not seeing the redraw or close widgets on
> GStephen> the plot windows I produce. 
> 
> Your post says you are a new user but the content suggests you've used
> matplotlib before.
I have played with version 0.50 a bit before, but I asked about the
"missing" widgets because they're still in the online tutorial. Plus, I
had thought the redraw button would be a convenient way to reset a plot
to its default after zooming and/or scrolling in one or the other axis. 
This last function is one I actually need, but I was unable to see
anywhere in the documentation how it might be done.
> As for the FC1 [compile] problem,
This turned out to be SOE (Stupid Operator Error). I didn't have the
tk-devel and tcl-devel packages installed. Unfortunately the lack of
tk.h and/or tcl.h causes so many error messages in the compile that the
line complaining about their lack is easy to miss. Not a matplotlib
problem, I hasten to add.
Thanks for the responses.
From: John H. <jdh...@ac...> - 2004年07月19日 15:55:17
>>>>> "Darren" == Darren Dale <dd...@co...> writes:
 Darren> Can text created with mathtext can be rotated? I am trying
 Darren> to label a y axis like y = ylabel(r'$rm{Temperature}
 Darren> (^\circ C)$') and y.set_rotation() does not respond to
 Darren> 'horizontal' or 'vertical' settings.
Vertical rotation is not supported yet. I adjust the alignment args
so at least the horizontal ylabels are in the right place
 ylabel(r'$\Delta_{i+1}$', fontsize='x-large',
 verticalalignment='center',
 horizontalalignment='right',
 rotation='horizontal'
 )
The good news is that Jim Benson just sent me a patch to support
vertical mathtext in *Agg, which will be included in the next release.
Cheers,
JDH
From: John H. <jdh...@ac...> - 2004年07月19日 15:53:31
>>>>> "Jonathan" == Jonathan Hanson <ha...@ph...> writes:
 > [Fri Jul 16 16:30:30 2004] [error]
 > [Fri Jul 16 16:30:30 2004] [error] from backend_gtkagg import
 > error_msg, draw_if_interactive, show, new_figure_manager
Here is your problem - a web app server should not be using gtkagg
(this is a GUI interface). You should be using Agg (which doesn't
require X11, a DISPLAY var etc).
You can either set backend : Agg to be your default backend in
matplotlib rrc - http://matplotlib.sf.net/.matplotlibrc or do the
following at the top of your script (before importing
matplotlib.matlab)
import matplotlib
matplotlib.use('Agg')
from matplotlib.matlab import .... whatever you usually do
Should work...
JDH
From: John H. <jdh...@ac...> - 2004年07月19日 15:50:23
>>>>> "Darren" == Darren Dale <dd...@co...> writes:
 Darren> Hi Everyone, I'm having trouble saving plot images with
 Darren> the *Agg backends. I've tried TkAgg, GTKAgg, WXAgg, and
 Darren> get the following error message (here for WXAgg):
 Darren> Do not know how to handle extension *.jpg 14:48:54 Debug
 Darren> e:\Projects\wx2.4\src\msw\app.cpp(439):
 Darren> 'UnregisterClass(canvas)' failed with error 0x00000584
 Darren> (class still has open windows)
 Darren> WX and GTK backends work. I'm using the precompiled 0.60.2
 Darren> version of Matplotlib (congratulations on the new
 Darren> release), python 2.3.4, windows XP. I'm calling my program
 Darren> from a DOS prompt to get the error messages, working in
 Darren> non-interactive mode and trying to save the image using
 Darren> the save-button widget.
The agg backend can only save png, ps, eps, and svg. jpeg is
available from backend_wx and backend_gtk. Personally, I've never
encountered a figure for which jpeg was a better output format than
png, which is why I haven't worked to provide a jpeg output to agg,
but it would be a good thing to add, at some point.
Cheers,
JDH
From: John H. <jdh...@ac...> - 2004年07月19日 15:48:28
>>>>> "GStephen" == Stephen Walton <ste...@cs...> writes:
 GStephen> As a new user of matplotlib, I'm surprised I haven't
 GStephen> seen this mentioned, offhand, in the mailing list
 GStephen> archive. I am not seeing the redraw or close widgets on
 GStephen> the plot windows I produce. The platform is Fedora Core
 GStephen> 1, although I built on RHEL3 because matplotlib-0.60-2
 GStephen> won't build on FC1 (some problem with tk-devel,
 GStephen> apparently).
Your post says you are a new user but the content suggests you've used
matplotlib before. In early versions there was both a redraw button
and a close button. The former was there because sometimes the figure
would get into an inconsistent state (after exposes, or resizes for
example) but these problems were fixed and I no longer saw a need for
it. The close button was dropped after Steve Chaplin pointed me to
some user interface design guidelines that argued close buttons should
never be placed on toolbars. So it is by design that these are
missing. Is this a problem for you?
As for the FC1 problem, perhaps Fernando Perez can comment - I
believe he has used matplotlib with FC1. I have no experience here.
JDH
From: Arnd B. <arn...@we...> - 2004年07月19日 07:33:31
Hi,
I am following this mailing list for a while now
and considering to convert to matplotlib at some point.
Whether this is feasable depends on the following two points:
1) I would like to know if there is an equivalent to the
 scipy.xplt.mouse command which (in its simplest form)
 waits for a mouse click and returns its coordinates:
Example:
#-------------------------------------
from scipy.xplt import *
x=arange(0.0,1.0,0.1)
plg(x*x,x)
m=mouse(1,-1,"click with the mouse")
print "x,y=",m[0],m[1]
#-------------------------------------
 John's reply
 http://mail.python.org/pipermail/python-list/2004-April/216550.html
 shows that it is possible to connect mouse events with functions.
 However, that code depends on the back-end and is not as
 short as the above one (though more flexible, of course ;-).
2) For one set of applications I would like to be able to plot
 several times 1000 points (or more).
 Optimally would be to plot one point after another
 to get a dynamical impression.
 In the application I have in mind there would be no
 need to store these points (ie zooming is not necessary)
 which normally degrades performance.
 Presently for me the solution for this type of things
 is our PlottingCanvas for wxPython, see
 http://www.physik.tu-dresden.de/~baecker/python/plot.html
 and there the StandardMap.py example.
 (this is not to advertise this, but just that you
 get an idea of what I have in mind.
 In the code there are couple of tricks to speed things up).
 In the end I would be happy to dump our PlottingCanvas
 in favour of matplotlib!
Best,
Arnd
From: Malte M. <Mal...@cs...> - 2004年07月19日 06:56:15
I have sarge (with a few unstable bits and pieces)
It 'shouldn't' be dependent on "unstable".
You can always see what extra libs it wants and decide then if you wnat 
it or not.
Cheers,
Malte.
Arnd Baecker wrote:
>
>
>Before I screw up my installation ;-)
> - did anyone successfully use these on sarge (debian testing)?
> - and/or are there deb's available for sarge?
>
>Many thanks,
>
>Arnd
> 
>
5 messages has been excluded from this view by a project administrator.

Showing results of 166

<< < 1 2 3 4 5 .. 7 > >> (Page 3 of 7)
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /