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






Showing results of 120

<< < 1 2 3 4 5 > >> (Page 3 of 5)
From: John H. <jdh...@ac...> - 2004年10月14日 17:30:59
>>>>> "Moe" == Moe Aboulkheir <mo...@po...> writes:
 Moe> sorry i did not explain fully. due to the asynchronous
 Moe> nature of the twisted framework, most blocking operations are
 Moe> generally executed inside threads, or at least, they are in
 Moe> my case.
I figured as much.
 Moe> thank you, and indeed i am confused, however i am using
 Moe> matplotlib 0.60.2, and here is the method declaration for
 Moe> Figure's __init__ (from matplotlib/figure.py):
 Moe> also in 0.60.2 i noticed that ticker.DayMultiLocator is used
 Moe> on line 1518 of matplotlib/axes.py but is not imported
Both of these are fixed in the current matplotlib release. You may
want to consider upgrading, particularly if you are actively writing
date code, since the date handling has changed and it may be less
painful to upgrade sooner rather than later when you have a large code
base installed. See the release notes at what's new for matplotlib
0.63.
Also, *many* memory leaks have been fixed - for web applications, this
may be important.
 Moe> the example you sent looks to be most helpful, thanks for
 Moe> taking the time to help me out.
 Moe> Moe
From: Jean-Michel P. <jea...@ir...> - 2004年10月14日 17:26:10
Attachments: coords.py
Hello,
I recently worked on displaying plot coordinates from the example code 
'coord_demo.py' so that I now have a script that should provide the 
following features:
 - coords are displayed either when clicking a mouse button or when 
stopping the mouse cursor in the plot for a given time (based on a timer)
 - coords can be displayed in the console or directly in the figure (a 
kind of balloon)
 - displayed coords are the nearest plot point coords provided the 
number of point distances to compute between mouse and curves is low 
enough to preserve resources, coords are only displayed if the smallest 
computed distance is "small" enough
 - coords displaying is activated by calling a unique function, its 
args define the type of event that triggers coords displaying and the 
callback that renders these coords (users can then provide their own one)
The callback that displays coords in a balloon uses the 'text' function 
of matplotlib.matlab such that this feature shouldn't rely on any backend.
Unfortunately things don't work for all backends. The results are the 
following:
		console displaying	balloon displaying
		------------------	------------------
WXAgg			OK			OK
TkAgg			OK			hangs
GTKAgg		nothing happens		nothing happens
Note that I never tried in an interactive session and I currently use 
matplotlib 0.62.4. In case some people are interested in having a look 
at my code, I attached it. This is a module that can be run as a 
standalone script for testing.
If things finally get work, I plan to add a backend-independent "cross 
hair" as 'wxcursor_demo.py' does using lines, and to highlight the 
nearest point in the figure by changing its color and/or its marker (but 
I still don't know how to!). I also wonder about the opportunity to add 
a toolbar button for this kind of tool. This would certainly require 
further improvements since my script seems to interact with the zoom 
tool callback while drawing the rectangle with the mouse. Moreover I 
only tested it for a single plot at the moment.
JM. Philippe
From: Moe A. <mo...@po...> - 2004年10月14日 16:30:46
John,
thanks for your very quick response.
> You may not be forced to do this; it depends on the circumstances.
> I've used the matlab interface to serve web pages before, though not
> with twisted. The use of the word global (in the example script
> pythonic_matplotlib) may not be the best choice, since the "globals"
> like the current figure and current axes are really module level
> variables that many modules access. But if you are creating figures
> in threads, this would be a problem. So the matplotlib API is a sound
> choice.
sorry i did not explain fully. due to the asynchronous nature of the 
twisted framework, most blocking operations are generally executed 
inside threads, or at least, they are in my case.
> I think you are confusing the figure linewidth with the plot
> linewidth. The Figure constructor does have a linewidth parameter in
> the __init__ method, though this is almost certainly not what you
> want. 
thank you, and indeed i am confused, however i am using matplotlib 
0.60.2, and here is the method declaration for Figure's __init__ (from 
matplotlib/figure.py):
class Figure(Artist):
 def __init__(self,
 figsize = None, # defaults to rc figure.figsize
 dpi = None, # defaults to rc figure.dpi
 facecolor = None, # defaults to rc figure.facecolor
 edgecolor = None, # defaults to rc figure.edgecolor
 frameon = True,
 ):
also in 0.60.2 i noticed that ticker.DayMultiLocator is used on line 
1518 of matplotlib/axes.py but is not imported
the example you sent looks to be most helpful, thanks for taking the 
time to help me out.
Moe
From: John H. <jdh...@ac...> - 2004年10月14日 14:41:46
>>>>> "Moe" == Moe Aboulkheir <mo...@po...> writes:
 Moe> Hey, i'm using matplotlib to create plots inside the twisted
 Moe> asynchronous web framework, so i am forced to use the
 Moe> pythonic API to avoid making global calls, however i have 3
 Moe> questions and would be extremely grateful if anyone could
 Moe> help me out.
You may not be forced to do this; it depends on the circumstances.
I've used the matlab interface to serve web pages before, though not
with twisted. The use of the word global (in the example script
pythonic_matplotlib) may not be the best choice, since the "globals"
like the current figure and current axes are really module level
variables that many modules access. But if you are creating figures
in threads, this would be a problem. So the matplotlib API is a sound
choice.
 Moe> 1) The online docs say that Figure.__init__ takes a linewidth
 Moe> keyword argument, but it does not. how can i set the
 Moe> linewidth for a figure, and how can i set the fontsize for a
I think you are confusing the figure linewidth with the plot
linewidth. The Figure constructor does have a linewidth parameter in
the __init__ method, though this is almost certainly not what you
want. This parameter controls the width of the line around the border
of the figure, a frame if you will, which is normally invisible
because the figure edge line and figure background color are both set
to white by default for saving figures. You are probably interested
in the lines.linewidth parameter which controls the default thickness
of all plot lines. This, and many more parameters, can be set in your
http://matplotlib.sf.net/.matplotlibrc file. You can also control the
default tick sizes, label sizes, colors, etc...
 Moe> figure, without doing weird things like map( lambda t:
 Moe> t.set_fontsize( 6 ), legend.get_texts() )
There are no default legend parameters in rc, so you'll have to
manually do it. You give up some of the convenience of the matlab
interface by using the api. Normally, one would use the matlab
interface 'set' command for this. In the example below, I include an
implementation of set called setapi that you may want to use in your
api code.
 Moe> 2) all of the examples using the pythonic API instantiate a
 Moe> Figure, and then do add_subplot(). this works for me, but
 Moe> matplotlib adds a bunch of space around the figure that i
 Moe> dont need. is there a way around this, or an alternative to
 Moe> add_subplot if i want only one plot?
Sure; use fig.add_axes. Then you can specify the left, bottom, width
and height of your axes as fractions of the entire figure size.
add_subplot is merely a convenience function to predefine some useful
axes sizes, but for full control, you'll want to set the axes size
yourself.
 Moe> 3) my ticklabels for the X axis happen to be quite lengthy
 Moe> strings, and they overlap if placed horizontally, adjacent to
 Moe> each other. i am using rotation = 45 but then a lot of the
 Moe> text gets clipped off of the bottom of the figure (im setting
 Moe> figsize in the Figure constructor). i am happy with the size
 Moe> of the figure, but would like more space for the text at the
 Moe> bottom.
Again, this is a problem with the default axes size. By making the
bottom a little higher, you can prevent your text from getting
clipped. The other option (you may want to do both) is use a smaller
fontsize for your tick labels.
 Moe> any help will be greatly appreciated. Moe Aboulkheir
Since there really was no true OO example for the agg backend, I wrote
one. It gives examples of how to solve all the problems you
encountered - this is examples/webapp_demo.py in CVS.
#!/usr/bin/env python
# This example shows how to use the agg backend directly to create
# images, which may be of use to web application developers who want
# full control over their code without using the matlab interface to
# manage figures, figure closing etc.
#
# I am making no effort here to make a figure that looks good --
# rather I am just trying to show the various ways to use matplotlib
# to customize your figure using the matplotlib API
import matplotlib
matplotlib.use('Agg') # force the antigrain backend
from matplotlib import rc
from matplotlib.backends.backend_agg import FigureCanvasAgg
from matplotlib.figure import Figure
from matplotlib.cbook import iterable
import matplotlib.numerix as nx
# Set some properties that affect the defaults of all figures. The rc
# command is used to create per-script default figure customizations
# of the rc parameters; see http://matplotlib.sf.net/.matplotlibrc .
# You may prefer to set the rc parameters in the rc file itself. Note
# that you can keep directory level default configurations by placing
# different rc files in the directory that the script runs in.
rc('lines', linewidth=2) # thicker plot lines
rc('grid', color=0.75, linestyle='-') # solid gray grid lines
rc('axes', hold=True, # hold state is on
 grid=True, facecolor='y') # yellow background, grid on
rc('tick', color='r', labelsize=20) # big red ticks
def setapi(o, **kwargs):
 """
 for all key, value pairs in kwargs, and all objects in (possibly)
 iterable o, look for a method o.set_key and try to call
 o.set_key(value) if it exists. This is basically a refinition of
 the matlab interface set command
 """
 if not iterable(o): o = [o]
 for thiso in o: # iterate over the objects
 for k,v in kwargs.items():
 func = getattr(thiso, 'set_'+k)
 if func is None: continue
 func(v)
def make_fig():
 """
 make a figure
 No need to close figures or clean up since the objects will be
 destroyed when they go out of scope
 """
 fig = Figure()
 #ax = fig.add_subplot(111) # add a standard subplot
 # add an axes at left, bottom, width, height; by making the bottom
 # at 0.3, we save some extra room for tick labels
 ax = fig.add_axes([0.2, 0.3, 0.7, 0.6])
 line, = ax.plot([1,2,3], 'ro--', markersize=12, markerfacecolor='g')
 # make a translucent scatter collection 
 x = nx.rand(100)
 y = nx.rand(100)
 area = nx.pi*(10 * nx.rand(100))**2 # 0 to 10 point radiuses
 c = ax.scatter(x,y,area)
 c.set_alpha(0.5) 
 # add some text decoration
 ax.set_title('My first image')
 ax.set_ylabel('Some numbers') 
 ax.set_xticks( (.2,.4,.6,.8) )
 labels = ax.set_xticklabels(('Bill', 'Fred', 'Ted', 'Ed'))
 # To set object properties, you can either iterate over the
 # objects manually, or define you own set command, as in setapi
 # above.
 #setapi(labels, rotation=45, fontsize=12)
 for l in labels:
 l.set_rotation(45)
 l.set_fontsize(12)
 
 canvas = FigureCanvasAgg(fig)
 canvas.print_figure('webapp.png', dpi=150)
make_fig()
From: Moe A. <mo...@po...> - 2004年10月14日 10:23:00
Hey,
i'm using matplotlib to create plots inside the twisted asynchronous web 
framework, so i am forced to use the pythonic API to avoid making global 
calls, however i have 3 questions and would be extremely grateful if 
anyone could help me out.
1) The online docs say that Figure.__init__ takes a linewidth keyword 
argument, but it does not. how can i set the linewidth for a figure, 
and how can i set the fontsize for a figure, without doing weird things like
map( lambda t: t.set_fontsize( 6 ), legend.get_texts() )
2) all of the examples using the pythonic API instantiate a Figure, and 
then do add_subplot(). this works for me, but matplotlib adds a bunch 
of space around the figure that i dont need. is there a way around 
this, or an alternative to add_subplot if i want only one plot?
3) my ticklabels for the X axis happen to be quite lengthy strings, and 
they overlap if placed horizontally, adjacent to each other. i am using 
rotation = 45 but then a lot of the text gets clipped off of the bottom 
of the figure (im setting figsize in the Figure constructor). i am 
happy with the size of the figure, but would like more space for the 
text at the bottom.
any help will be greatly appreciated.
Moe Aboulkheir
From: John H. <jdh...@ac...> - 2004年10月13日 21:00:18
>>>>> "Humufr" == Humufr <hu...@ya...> writes:
 Humufr> Hi, the problem who appearded with the
 Humufr> new pygtk version is resolved. Thanks to John and the guys
 Humufr> from pygtk.
 Humufr> http://bugzilla.gnome.org/show_bug.cgi?id=155304
Great. Thanks for your help testing and tracking this one down. I
updated the matplotlib FAQ
 http://matplotlib.sourceforge.net/faq.html#PYGTK24
Make sure that I got it right!
JDH
From: Humufr <hu...@ya...> - 2004年10月13日 20:42:01
 Hi,
the problem who appearded with the new pygtk version is resolved. Thanks 
to John and the guys from pygtk.
http://bugzilla.gnome.org/show_bug.cgi?id=155304
 Nicolas
From: Darren D. <dd...@co...> - 2004年10月13日 15:50:18
On Wednesday 13 October 2004 09:22 am, John Hunter wrote:
> >>>>> "Darren" == Darren Dale <dd...@co...> writes:
>
> Darren> I am seeing some strange behavior during IPython and
> Darren> vanilla Python interactive sessions. My .matplotlibrc is
> Darren> not being respected. I have tried making changes to the
> Darren> copy in my home diretory and the one in
> Darren> /usr/share/matplotlib. If I run the commands below or do
> Darren> an execfile('/home/darren/test.py') from an interactive
> Darren> session, .matplotlibrc is not read. If I run the script
> Darren> from the console, .matplotlibrc is read.
>
> Darren> I'm on gentoo with either 0.63.0 or the current cvs,
> Darren> python 2.3.3. Has anyboody else seen this?
>
>
> Darren> from matplotlib.matlab import * a=[1,10,100,1000,10000]
> Darren> figure(1) loglog(a,a) figure(2) plot(a,a) show()
>
> Changes to rc made after you have started an interactive session would
> not be expected to have an effect -- the rc file is parsed when any
> matplotlib module is imported and not parsed again. If you make some
> obvious change to the rc file in your home dir, say
>
I understand that these .matplotlibrc changes must be made before importing 
matplotlib. The problem I was having was that the file was not being read 
when starting ipython -pylab. I have reinstalled MPL a couple times now, and 
can't reproduce the problem.
Darren
From: John H. <jdh...@ac...> - 2004年10月13日 14:13:06
>>>>> "Darren" == Darren Dale <dd...@co...> writes:
 Darren> I am seeing some strange behavior during IPython and
 Darren> vanilla Python interactive sessions. My .matplotlibrc is
 Darren> not being respected. I have tried making changes to the
 Darren> copy in my home diretory and the one in
 Darren> /usr/share/matplotlib. If I run the commands below or do
 Darren> an execfile('/home/darren/test.py') from an interactive
 Darren> session, .matplotlibrc is not read. If I run the script
 Darren> from the console, .matplotlibrc is read.
 Darren> I'm on gentoo with either 0.63.0 or the current cvs,
 Darren> python 2.3.3. Has anyboody else seen this?
 Darren> from matplotlib.matlab import * a=[1,10,100,1000,10000]
 Darren> figure(1) loglog(a,a) figure(2) plot(a,a) show()
Changes to rc made after you have started an interactive session would
not be expected to have an effect -- the rc file is parsed when any
matplotlib module is imported and not parsed again. If you make some
obvious change to the rc file in your home dir, say
figure.facecolor : g # figure facecolor; 0.75 is scalar gray
and *restart* ipython, do the changes take effect?
Note that you don't need to execfile with ipython, since that is what
the ipython 'run' command is for, and run does some smart things
before exec-ing your file, namely turning interactive off for the
duration of the run, which is more efficient.
There has been some interest in a loadrc command, which would be used
to load a specified rc file from the command line or script. Should
be easy to add, and it is on the todo list.
Note that matplotlib in CVS has a new verbose setting which is
described at the bottom of the rc file. By changing the verbose
setting to helpful, it will give you diagnostic information when you
run, including which rc file is loaded. If you continue having
trouble with this, I suggest grabbing the latest from CVS and try
running with verbose : helpful.
JDH
From: John H. <jdh...@ac...> - 2004年10月13日 14:04:51
>>>>> "Humufr" == Humufr <hu...@ya...> writes:
 Humufr> Hi, I think to have found a bug in axis. You can't
 Humufr> choose a multiplelocator with 0.5 or 0.3 for example, you
 Humufr> can but the result is not what you're expecting. (see fig1
 Humufr> for the effect)
This appears to be a bug in your code
 xmajorLocator = MultipleLocator(0.3)
 xmajorFormatter = FormatStrFormatter('%d')
 ^^^
You are telling it to format the numbers as integers. Try 
 xmajorFormatter = FormatStrFormatter('%1.2f')
 Humufr> Another funny script (see scripts2 and scripts3) with tick
 Humufr> problem. Compare the two following scripts, the only
 Humufr> difference is to tell to yaxis to use the same
 Humufr> characteristic than xaxis. The very funny thing is to
 Humufr> change the ymajorLocator in xmajorLocator and etc with
 Humufr> you're doing the setting for the y axis... That influx in
 Humufr> the x axis. See fig2 and fig3.
 Humufr> Perhaps (probably) I'm doing something bad but I'm not
 Humufr> able to find where.
This is a problem with matplotlib but I don't have a quick fix for
you. I'll look into it more when I get some time. For now, sharing
the same tick locator between multiple axes is not recommended, though
I understand this is a desirable thing to be able to do. You can make
two identical locators, however, and shouldn't have troubles, which if
I understand you correctly, is what you observe.
JDH
From: Humufr <hu...@ya...> - 2004年10月13日 04:58:02
 Hi John,
I'm using a debian linux with gcc 3.3.5, pygtk 2.4.0, precompiled
It's definitively a problem with pygtk2.4 because I have no problem to 
compile with 2.0 (from testing). Morever the problem comes only with the 
compilation. If I compile matplotlib with pygtk 2.2.0 I have no problem 
to use matplotlib even if I'm upgrading pygtk to 2.4.0. The problem 
seems to be in the header who comes from pygtk but I know nothing in 
these sort of file so I can't debug it.
Thanks,
 Nicolas
 > gcc -v
Reading specs from /usr/lib/gcc-lib/i486-linux/3.3.5/specs
Configured with: ../src/configure -v 
--enable-languages=c,c++,java,f77,pascal,objc,ada,treelang --prefix=/usr 
--mandir=/usr/share/man --infodir=/usr/share/info 
--with-gxx-include-dir=/usr/include/c++/3.3 --enable-shared 
--with-system-zlib --enable-nls --without-included-gettext 
--enable-__cxa_atexit --enable-clocale=gnu --enable-debug 
--enable-java-gc=boehm --enable-java-awt=xlib --enable-objc-gc i486-linux
Thread model: posix
gcc version 3.3.5 (Debian 1:3.3.5-1)
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O3 -Wall 
-Wstrict-prototypes -fPIC -I/usr/local/include -I/usr/include 
-I/usr/include/pygtk-2.0 -I/usr/include/glib-2.0 
-I/usr/lib/glib-2.0/include -I/usr/include/gtk-2.0 
-I/usr/lib/gtk-2.0/include -I/usr/include/glib-2.0 
-I/usr/lib/glib-2.0/include -I/usr/include/python2.3 -c test.cpp
In file included from /usr/include/python2.3/Python.h:8,
 from /usr/include/pygtk-2.0/pygobject.h:5,
 from test.cpp:8:
/usr/include/python2.3/pyconfig.h:856:1: warning: "_POSIX_C_SOURCE" 
redefined
In file included from /usr/include/string.h:26,
 from /usr/include/c++/3.3/cstring:51,
 from test.cpp:1:
/usr/include/features.h:131:1: warning: this is the location of the 
previous definition
In file included from test.cpp:8:
/usr/include/pygtk-2.0/pygobject.h:140: error: parse error before `typename'
/usr/include/pygtk-2.0/pygobject.h:147: error: parse error before `typename'
and when I put the pkg-config inside the line a obtain exactly the same 
thing.
 gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O3 -Wall 
-Wstrict-prototypes -fPIC -I/usr/local/include -I/usr/include 
-I/usr/include/pygtk-2.0 -I/usr/include/glib-2.0 
-I/usr/lib/glib-2.0/include -I/usr/include/gtk-2.0 
-I/usr/lib/gtk-2.0/include -I/usr/include/glib-2.0 
-I/usr/lib/glib-2.0/include -I/usr/include/python2.3 `pkg-config-c test.cpp
`pkg-config
gruel@wheeloftime:~/Matplotlib$ gcc -pthread -fno-strict-aliasing 
-DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include 
-I/usr/include -I/usr/include/pygtk-2.0 -I/usr/include/glib-2.0 
-I/usr/lib/glib-2.0/include -I/usr/include/gtk-2.0 
-I/usr/lib/gtk-2.0/include -I/usr/include/glib-2.0 
-I/usr/lib/glib-2.0/include -I/usr/include/python2.3 `pkg-config 
pygtk-2.0` -c test.cpp
In file included from /usr/include/python2.3/Python.h:8,
 from /usr/include/pygtk-2.0/pygobject.h:5,
 from test.cpp:8:
/usr/include/python2.3/pyconfig.h:856:1: warning: "_POSIX_C_SOURCE" 
redefined
In file included from /usr/include/string.h:26,
 from /usr/include/c++/3.3/cstring:51,
 from test.cpp:1:
/usr/include/features.h:131:1: warning: this is the location of the 
previous definition
In file included from test.cpp:8:
/usr/include/pygtk-2.0/pygobject.h:140: error: parse error before `typename'
/usr/include/pygtk-2.0/pygobject.h:147: error: parse error before `typename'
From: Darren D. <dd...@co...> - 2004年10月13日 00:19:23
I am trying to make an animation. The examples provided in matplotlib work 
very well. In my own closely related code, I am plotting 3 lines, each 
containing 5000 doubles. Calls to manager.canvas.draw() take 0.4 seconds on 
my speedy gentoo setup, 0.15 seconds if I dont use mathtext tick labels. So I 
dont think this has anything to do with my numerix setup.
Is there a way around re-rendering the entire canvas?
Thanks,
Darren
From: John H. <jdh...@ac...> - 2004年10月12日 22:52:33
 Humufr> Hi, like other people in these list, I can't
 Humufr> compile matplotlib anymore with pygtk 2.4. I have the same
 Humufr> error than the others. I don't know C so I understand
 Humufr> nothing in these message. Someone was arriving to correct
 Humufr> this problem please?
The failure occurs at line 8 of src/_gtkagg.cpp; there is no
matplotlib code on line 8 or above, so I do not believe it is a
matplotlib problem. I think it is either a pygtk problem or a problem
with your environment (does your pkg-config point to the proper pygtk
install path?). Below is a c++ file that is identical to _gtkagg.cpp
up to the failing line, which is the gobject import. After that it
just prints hello world.
Try compiling it with (where the python include path should point to
Python.h)
 > g++ test.cpp `pkg-con-2.0` -I/usr/local/include/python2.3/
Are you using gcc-3.4? This seems to be a specific problem with
gcc-3.4 and pygtk-2.4. It would be helpful if you post your gcc
version, platform and pygtk version.
Please let me know if you learn anything else. If you fail to compile
the minimal example below, check your pygtk pkg-config paths and
consider posting this example to the pygtk mailing list; Niklas posted
and got no response, but he didn't have a minimal example which will
make a world of difference in people's ability to help.
Unfortunately, I don't have access to a machine with gcc-3.4 and the
latest pygtk to test with.
//test.cpp
#include <cstring>
#include <cerrno>
#include <cstdio>
#include <iostream>
#include <cmath>
#include <utility>
#include <pygobject.h>
int main() {
 std::cout << "hello gtk" << std::cout;
}
From: Humufr <hu...@ya...> - 2004年10月12日 20:41:58
 Hi,
like other people in these list, I can't compile matplotlib anymore with 
pygtk 2.4. I have the same error than the others. I don't know C so I 
understand nothing in these message. Someone was arriving to correct 
this problem please?
Thanks,
 Nicolas
building 'matplotlib.backends._gtkagg' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O3 -Wall 
-Wstrict-prototypes -fPIC -I/usr/local/include -I/usr/include -Isrc 
-Iagg22/include -I. -I/usr/local/include -I/usr/include 
-I/usr/local/include/freetype2 -I/usr/include/freetype2 -Isrc/freetype2 
-Iagg22/include/freetype2 -I./freetype2 -I/usr/local/include/freetype2 
-I/usr/include/freetype2 -I/usr/local/include -I/usr/include 
-I/usr/include/pygtk-2.0 -I/usr/include/glib-2.0 
-I/usr/lib/glib-2.0/include -I/usr/include/gtk-2.0 
-I/usr/lib/gtk-2.0/include -I/usr/X11R6/include -I/usr/include/atk-1.0 
-I/usr/include/pango-1.0 -I/usr/include/freetype2 
-I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include 
-I/usr/include/python2.3 -c src/_gtkagg.cpp -o 
build/temp.linux-i686-2.3/src/_gtkagg.o
In file included from /usr/include/python2.3/Python.h:8,
 from /usr/include/pygtk-2.0/pygobject.h:5,
 from src/_gtkagg.cpp:8:
/usr/include/python2.3/pyconfig.h:856:1: warning: "_POSIX_C_SOURCE" 
redefined
In file included from /usr/include/string.h:26,
 from /usr/include/c++/3.3/cstring:51,
 from src/_gtkagg.cpp:1:
/usr/include/features.h:131:1: warning: this is the location of the 
previous definition
In file included from src/_gtkagg.cpp:8:
/usr/include/pygtk-2.0/pygobject.h:140: error: parse error before `typename'
/usr/include/pygtk-2.0/pygobject.h:147: error: parse error before `typename'
error: command 'gcc' failed with exit status 1
From: John H. <jdh...@ac...> - 2004年10月12日 14:12:25
>>>>> "BDayton" == BDayton <BD...@co...> writes:
 BDayton> Hi,
 BDayton> I have produced a figure and used 'fill' to plot regions
 BDayton> in that figure. I wanted to place a legend for it, but
 BDayton> when I tried it only the labels appeared - no coloured
 BDayton> squares indicating the colours of the fills, as you get
 BDayton> in Matlab. Is it possible to do this? I noticed in one of
 BDayton> the example scripts that it works with a barchart. I
 BDayton> would like to use it in the same way, but with 'fill's.
In matplotlib/legend.py, on line 182, try replacing 
 elif isinstance(handle, Rectangle):
with 
 elif isinstance(handle, Patch):
and try again. If it fails, please send in an example script that
exposes the problem, but let me know in any case. Note this solution
will still draw a little rectangle in the legend rather than a
miniature polygon the same shape as the fill one, but it will
otherwise have the same properties (eg facecolor). What does matlab do?
Cheers,
JDH
From: <BD...@co...> - 2004年10月12日 07:09:39
Hi,
I have produced a figure and used 'fill' to plot regions in that figure. I
wanted to place a legend for it, but when I tried it only the labels
appeared - no coloured squares indicating the colours of the fills, as you
get in Matlab. Is it possible to do this? I noticed in one of the example
scripts that it works with a barchart. I would like to use it in the same
way, but with 'fill's.
Cheers,
Brionie
==============================================
"The information contained in this e-mail message may be confidential information, and may also be privileged. If you are not the intended recipient, any use, interference with, disclosure or copying of this material is unauthorised and prohibited. If you have received this message in error, please notify us by return email and delete the original message."
From: Alexander S. <a.s...@gm...> - 2004年10月12日 00:25:52
Hi,
First of all let me congratulate you[1] on your work on Matplotlib -- it so
evidently superior to all the other stuff around for python that it might
actually obviate the need for a little "universal" plotting frontend (anyplot
) as matplotlib is the first such package that would deserve to become a
de-facto standard for plotting in python.
Nonetheless, I've already written most of the foundations and I think it might
actually still be useful (currently e.g. matplotlib still is a bit difficult
to install, and whilst the CVS version apparently already has quite good
support for interactive plotting, at least some features such as good 3D
plotting will likely take longer; and matlab, which is fully supported as
backend for anyplot will likely maintain an edge for a number of plotting
tasks for the immediate future)[2].
To come to the point, recently I've invested a little bit of time to add
matplotlib support[3] and whilst I have been generally postively surprised [4]
both by the quality of the output as well as the ease to get things to work,
there are still a few comments and questions I have:
Here are some things that would be nice to see:
 - AFAICT there is no equivalent to matlab's .fig internal format -- this
 is quite a shame, one of the reasons I why I think a fairly simple
 wrapper like anyplot should get one quite a long way is that I'd guess
 that when excellent visual results are actually important then the
 easiest way might well be to create some "templates" with the
 gui/backend specific commands and use them as prototypes/style-sheets.
 It should of course also be possible to query the underlying plotting
 package and use it's unique functionality where required; there are a
 few places in my code that do that for matlab but it's really not needed
 often and thus doesn't hamper migrating to another backend much.
 I'm planning to adding was some 'record'/'playback' functionality with a
 metaclass i.e. some internal anyplot specific save-format that can be
 used to recreate plots with any available backend -- but this is no full
 substitute because it will only (portably) work for things supported by
 all backends.
 - gcf returns a figure handle -- it would be nice if there were some obvious
 way to get back an integer instead -- I haven't found one yet
 - the LaTeX rendering backend unfortunatly doesn't support any accents
 (\hat{a},\bar{x} etc.); also for me the fact that it doesn't accept normal
 text with $math$ inside happens to be quite a bother -- I can't imagine that
 either of these would be hard to fix.
 - colormap is rather limited in matlab compatibility -- it would be at
 least having some of matlab's colormaps around as functions like `jet`.
 - `ishold` and `spy` are amongst the functions that are missing but would
 be quite easy to add -- ishold in particular would be very useful
 (unlike with gcf I quickly found some way to query the hold-state, but
 that interface might change and anyway it's a generally useful
 facility).
 - plot apparently doesn't know about the "*"-marker style -- this looks
 like a mere oversight (I think all the other marker styles that matlab
 has are supported)
 - the plot command is much more restrictive in what it accepts as inputs;
 ``plot(x1,y2,'r', x2,y2, 'b')`` e.g. would be illegal. This isn't much
 of a problem for me since I've written some code to "parse" plot
 arguments, but I think it's a bit inconvenient. For anyplot I've added
 some more options since I for example found I mainly wanted to use
 several y-vectors against a single x it is also possible to do something
 like e.g ``plot(y1, 'r', y2, 'g+', y3, ':', x='auto', norm=1,
 log='x')``. OTOH I think it might be best to be conservative about
 adding such features before one has a good idea what common use patterns
 are likely to look like (convenience functions could provide a good
 testbed for such ideas). 
 - something like axis('manual') would be nice (maybe under a more
 descriptive name) otherwise it's inconvenient to add additional plots
 into boundaries defined by some original plot that is of main interest.
 Unfortunately axis is one of matlab's slightly more overloaded functions
 -- in many of these cases one would think that python's more flexible
 parameter passing syntax (keywords, inter alia) would allow better
 signatures than what matlab's designers came up with (as far as I can
 see matplotlib already makes quite a lot of use kwargs)
Generally anyplot stays closer to matlab in it's interface, but there
are two commands I found too ugly to follow suit exactly:
- matlab's ``text(x,y,[z], string)`` is ``anyplot.text(string, x,y,[z])``
 Is there already a plan what matplotlib going to do about z coords for text,
 once it supports 3D plots?
- `subplot` is just too bloody awkward -- so I deprecated it and instead
 added a `multi` and `refocus` commands, here are the signatures::
 def multi(self,rows,cols=1):
 """Create a multiplot with specified number of `rows` and `cols`. Use
 `refocus` to access the desired cell. Supersedes `subplot`.
 see: `refocus`
 """
 def refocus(self,M=None,N=None):
 """Change focus to the desired subplot in a figure.
 - ``refocus()``
 focus on next multiplot cell (order: right-to-left,
 top-to-down, 0 index)
 - ``refocus(M)``
 focuses on multiplot cell ``M`` (order: same as above)
 - ``refocus(M,N)``
 focuses on multiplot cell at row ``M``, column ``N``
 see: `multi`
 """
I'd generally like to keep anyplot's interface the same as (or at least a
subset or superset of) matplotlib's where ever it makes sense, I'm not quite
convinced about `text` though (I'm not sure how useful z coords for text
really are, if they aren't used even with 3D plot passing them as a keyword,
unfortunately keywords are used to update the font dict; maybe a better
approach would be to use something like (ignoring details like the ordering of
coords and text for the moment)::
 fontInfo = FontInfo(font='Helvetica', height=13, etc='...')
 text(str1, x1, y1 font=fontInfo(height=10))
 text(str2, x2, y2 font=fontInfo(color='red'))
instead of::
 fontInfo = {'font': 'Helvetica', 'height': 13, etc:'...'}
 text(str1, x1, y1 fontdict=fontInfo, height=10)
 text(str2, x2, y2 fontdict=fontInfo, color='red')
because that doesn't scale so well (one no longer can simply add keywords args
for non font-info stuff).
Here `fontInfo` is some structure type that on call creates an updated *copy*.
I've found this quite useful for other things so I've got an implementation
handy: [5]
I'm also wondering how much the interface has already settled down? BTW, one
thing that would be nice is if any sequence dependent quirks (where
unavoidable) would be the same as in matlab, because that would be quite
difficult to work around in anyplot otherwise (e.g. the order of `title`,
`subplot` and `plot`, IIRC; some like the way plot interacts with logplots and
hold might be easier to work around -- I'm still not sure what the best
behavior ist does matplotlib have any fixed policy here already?).
Cheers,
'as
P.S. I will be off-line for about a month from tomorrow noon onwards, so please
 excuse extreme reply latencies ;) -- I'm unlikely to read anything for
 a month that posted after the next 10/12hrs.
P.P.S. For those who are curious about anyplot, my imminent long off-line
 period finally gave me the push to try to package up all the
 non-pre-alpha stuff I've created over the years and put it on a web
 page in the hope it might be useful for other. Thus hopefully, by
 tomorrow you anyplot and some other possibly useful stuff like my
 high-level matlab-bridge can be found here:
 http://www.dcs.ex.ac.uk/~aschmolc/
 (In the possibly unlikely event that there's some code that would be
 useful for matplotlib -- don't hestitate to take it, license issues
 should be no problem)
P.P.S. A final note: wouldn't it be nicer to have some python-syntax rc file?
 It can always be a safe subset if there are security concerns, but I'd
 rather not have yet another limited and (difficult to extend)
 config-file syntax.
Footnotes: 
[1] you here refers to everyone who helped to rapidly transform matplotlib
 into a the to be reckoned with, rather than the zillionth half-arsed and
 bug-ridden plotting package to linger around for years without getting
 anywhere -- first and foremost that credit must of course belong to John
 Hunter.
[2] I started it because I became frustrated with the code disruption caused by
 switching from one unsatisfactory python plotting package to the next I
 started a little, as yet unreleased project some time ago that I dubbed
 anyplot (after the now apparently defunct anygui project). The aim was to
 provide a uniform and (esp. for interactive work) efficient frontend to a few
 different promising backends, because
 a) at the time it wasn't clear on what horse to bet (all of them lamed a bit,
 and the ones that offered most functionality also seemed to suffer from the
 most deeply ingrained problems). 
 
 b) Different plotting packages for python did different things well so it
 seemed useful to easily be able to use specific backend for a certain task
 without having to deal with code changes or memorzing N-interfaces; the
 only one that did everything fairly well was matlab, via the high-level
 python-matlab bridge I wrote, but even matlab often leaves something to be
 desired and I didn't particularly want to be tied to it for eternity. For
 the past 1.5 years or I've almost exclusively used anyplot with matlab as
 backend for all my work, so that part should be fairly stable.
 
 c) Moreover most had rather painful interfaces -- I wanted something that was
 quick and convenient to use for interactive data exploration. I noticed
 that the vast majority of the time I didn't need fancier capabilities (or
 used the GUI to fine-tune the results), so I reckoned that providing a
 convenient set would be a useful and manageable task, much more so than
 what anypgui set out to do for GUIs. I also took matlab as a point of
 departure, because it is familiar to many people, but also because despite
 some baroqueness the interface is quite quick and efficient for common
 tasks (unlike many of the interfaces that strive for OO-purity).
 
[3] apart from that, at the moment there's also some xplt support, xplt is
 sufficiently dodgy that I won't invest much further time on this but it
 provides a IMO saner interface to most of the functionality; there's also
 some rather preliminary support for grace, which despite being somewhat
 limited in the type of plots it offers seems to do a few things quite
 well, is very fast and offers a fairly convenient gui; the only thing I'd
 still be interested in additionally supporting would be gnuplot, although
 some of gnuplots weirder limitations (e.g. line styles) would cause some
 awkwardness -- the good thing about gnuplot, though, is that it supports
 both 3D and 2D, zillions of output formats (including more exotic ones
 like ascii, latex and vt100), that it is widespread and runs just about
 on anything and finally that it won't go away anytime soon.
[4] Apart from the installation; I'm a bit spoilt as most libraries I want
 under debian just takes seconds to instal -- I had some trouble with the
 latest sources and eventually downloaded a debian package by hand from
 somewhere because that seemed the only way to get it to work.
[5] Here's the code (obviously not all of this class are would be needed, but
 it should give the idea; also note that it's very convenient to convert
 to/from dicts):
class Struct(object):
 r"""
 Examples:
 
 >>> brian = Struct(name="Brian", age=30)
 >>> brian.name
 'Brian'
 >>> brian.age
 30
 >>> brian.life = "short"
 >>> brian
 Struct(age=30, life='short', name='Brian')
 >>> del brian.life
 >>> brian == Struct(name="Brian", age=30)
 True
 >>> brian != Struct(name="Jesus", age=30)
 True
 >>> len(brian)
 2
 Call the object to create a clone:
 
 >>> brian() is not brian and brian(name="Jesus") == Struct(name="Jesus", age=30)
 True
 Conversion to/from dict:
 >>> Struct(**dict(brian)) == brian
 True
 Evil Stuff:
 
 >>> brian['name', 'age']
 ('Brian', 30)
 >>> brian['name', 'age'] = None, None
 >>> brian
 Struct(age=None, name=None)
 """
 def __init__(self,**kwargs):
 self.__dict__.update(kwargs)
 def __call__(self, **kwargs):
 import copy
 res = copy.copy(self)
 res.__init__(**kwargs)
 return res
 def __eq__(self, other):
 return self.__dict__ == other.__dict__
 def __ne__(self, other):
 return not self.__eq__(other)
 def __len__(self):
 return len([k for k in self.__dict__.iterkeys() if not (k.startswith('__') or k.endswith('__'))])
 # FIXME utterly perverse and UNTESTED
 def __getitem__(self, nameOrNames):
 if isString(nameOrNames):
 return self.__dict__[nameOrNames]
 else:
 return tuple([self.__dict__[n] for n in nameOrNames])
 # FIXME utterly perverse and UNTESTED 
 def __setitem__(self, nameOrNames, valueOrValues):
 if isString(nameOrNames):
 self.__dict__[nameOrNames] = valueOrValues
 else:
 for (n,v) in zip(nameOrNames, valueOrValues):
 self.__dict__[n] = v
 def __contains__(self, key):
 return key in self.__dict__ and not (key.startswith('__') or key.endswith('__'))
 def __iter__(self):
 for (k,v) in self.__dict__.iteritems():
 if not (k.startswith('__') or k.endswith('__')):
 yield k,v
 def __repr__(self):
 return mkRepr(self, **vars(self))
def mkRepr(instance, *argls, **kwargs):
 width=79
 maxIndent=15
 minIndent=2
 args = map(repr, argls) + ["%s=%r" % (k, v)
 for (k,v) in ipsort(kwargs.items())]
 if instance is not None:
 start = "%s(" % instance.__class__.__name__
 args[-1] += ")"
 else:
 start = ""
 if len(start) <= maxIndent and len(start) + len(args[0]) <= width and \
 max(map(len,args)) <= width: # XXX mag of last condition bit arbitrary
 indent = len(start)
 args[0] = start + args[0]
 if sum(map(len, args)) + 2*(len(args) - 1) <= width:
 return ", ".join(args)
 else:
 indent = minIndent
 args[0] = start + "\n" + " " * indent + args[0]
 return (",\n" + " " * indent).join(args)
From: John H. <jdh...@ac...> - 2004年10月11日 13:52:18
>>>>> "Alan" == Alan G Isaac <ai...@am...> writes:
 Alan> On 2004年10月08日, John Hunter apparently wrote:
 >> Could you send some example code when axis is used first with a
 >> description of what looks wrong to you on the plot?
 Alan> from scipy import * from matplotlib.matlab import *
 Alan> days=arange(31) dp = 3 plot(days,dp*days,'ro') #produce a
 Alan> zero axis axis([0,30,-40,100])
 Alan> axhline(linewidth=0.5,color=(0,0,0)) show()
 Alan> Version is 0.63. Ordered as above: axis is not honored.
 Alan> Switch the order of axis() and axhline(), and all is well.
I see. Note this isn't specific to axhline. For example, in 
 from matplotlib.matlab import *
 days=arange(31) 
 dp = 3 
 axis([0,30,-40,100])
 plot(days,dp*days,'ro')
 show()
the axis setting is also not obeyed because the plot command
autoscales the axes. FYI, I just tested this, and matlab behaves the
same way.
In general, I agree it would be nice in some cases to have sticky axis
limits. Probably the easiest and least intrusive way to do this would
be via a setting autoscale(False) or autoscale(True), and you could
set the default via rc. It would be easy in to check this setting in
the autoscale code before doing any work. It would be nice to be able
to access these settings in the axis or xlim/ylim commands
 axis(rect, autoscale=False) # autoscaling is off for x and y axis
 xlim(lim, autoscale=False) # autoscaling is off for x 
and so on.
Whether this is sufficiently useful to justify coding it is an open
question.
JDH
From: John H. <jdh...@ac...> - 2004年10月11日 13:33:58
>>>>> "Jean-Michel" == Jean-Michel Philippe <jea...@ir...> writes:
 Jean-Michel> Perfect! This is exactly what I needed for one of my
 Jean-Michel> apps.
Glad that worked for you.
 >> But if you really want full control with no magic globals, I
 >> suggest using the matplotlib API rather than the matlab
 >> interface. Here is a minimal example with the SVG backend to
 >> create a figure w/o the matlab interface
 Jean-Michel> Well, what do you exactly mean by full control? The
 Jean-Michel> fact that the figure is no more controlled by
 Jean-Michel> matplotlib.matlab (as matlab does) but under my own
 Jean-Michel> control? So that the application is now fully
 Jean-Michel> responsible for displaying it? 
 Jean-Michel> NB: currently I'm targeting TkAgg.
What I mean is that is that if you want to explicitly control when
your figure windows are shown, you need to use the matplotlib API, and
example of which for tkagg is at
http://matplotlib.sf.net/examples/embedding_in_tk.py. In this case,
you explicitly make the calls to show or hide your window when you
want. If you use the matlab interface, you are constrained either to
1) if interactive is False, show all of your figures at the end of the
script when you call show or 2) if interactive is True, show all your
windows at the time of their creation.
Actually, you may have a 3rd (untested, unsupported) option with the
matlab interface. Thanks to the changes Fernando and I introduced to
support ipython, I believe as of matplotlib 0.62 it is safe to call
show repeatedly without blocking script execution. You may want to
test this and report back.
 Jean-Michel> I'm afraid I don't understand why this should remove
 Jean-Michel> "magic" globals, I feel some globals are still
 Jean-Michel> required...
Some people do not like to use the matlab interface because it manages
the current figure and axes for them, behind the scenes. Eg when you
type plot(x,y), the plot command is sent to the current figure and
axes, as in matlab, which are stored as "global" (actually module
level) variables in matplotlib.matlab. In the matplotlib API, you
have to explicitly instantiate the figure and axes, and direct your
plotting, saving, etc commands to these instances, as in
 from matplotlib.numerix import arange, sin, pi
 from matplotlib.figure import Figure
 f = Figure(figsize=(5,4), dpi=100)
 a = f.add_subplot(111)
 t = arange(0.0,3.0,0.01)
 s = sin(2*pi*t)
 a.plot(t,s)
In a complex, nested application or script, it is sometimes nice to
have this extra degree of clarity.
Hope this helps,
JDH
From: Jean-Michel P. <jea...@ir...> - 2004年10月11日 08:17:37
jdh...@ac... wrote:
> In 0.63, we introduced a flag on the
> matplotlib.backends.draw_if_interactive function. If
I must say I'm really impressed how fast matplotlib gets improved!
> Eg , at the end of your script
> 
> if draw_if_interactive._called: show()
> 
> Note if you are using a pure image backend (eg agg, svg, ps) you do
> not need show at all; this is for GUI backends only. Just call
> savefig anywhere in your code.
Perfect! This is exactly what I needed for one of my apps.
> But if you really want full control with no magic globals, I suggest
> using the matplotlib API rather than the matlab interface. Here is a
> minimal example with the SVG backend to create a figure w/o the matlab
> interface
Well, what do you exactly mean by full control? The fact that the figure 
is no more controlled by matplotlib.matlab (as matlab does) but under my 
own control? So that the application is now fully responsible for 
displaying it? I'm afraid I don't understand why this should remove 
"magic" globals, I feel some globals are still required...
NB: currently I'm targeting TkAgg.
JM. Philippe
From: Todd M. <jm...@st...> - 2004年10月11日 00:29:56
On Sun, 2004年10月10日 at 15:47, Darren Dale wrote:
> Hello,
> 
> I am getting invalid numeric result exceptions when dividing a complex array 
> by zero. Is this the desired behavior?
This is what I would have expected, and examining the definition I have
for complex division in numarray/Include/numarray/numcomplex.h, I don't
see a problem. The definition should probably be checked by an extra
set of eyes. Looks OK to me.
> Also, while trying to find a way around the above problem, I ran 
> ieeespecial.test and got the following output. I am running numarray 1.1 on 
> python 2.3.3. Todd, this might be correlated with the numerix package in 
> matplotlib. I tried importing numarray and ieeespecial without matplotlib and 
> the ieeespecial.test was successful.
> 
I tried this with an ordinary Python shell and ieeespecial.test()
completed without errors. Looking at your test output, I noticed it
was skewed, and guessed there was an I/O synchronization issue messing
up doctest. I tried the same test under IPython w/o matplotlib and
duplicated your results, so I think the problem is an IPython/doctest
issue. 
Regards,
Todd
> Thanks,
> 
> Darren
> 
> 
> In [31]: ieeespecial.test()
> Out[31]: inf
> *****************************************************************
> Failure in example:
> inf # the repr() of inf may vary from platform to platform
> from line #6 of numarray.ieeespecial
> Expected: inf
> Got:
> Out[31]: nan
> *****************************************************************
> Failure in example:
> nan # the repr() of nan may vary from platform to platform
> from line #8 of numarray.ieeespecial
> Expected: nan
> Got:
> Out[31]: (array([0, 2]), array([0, 3]))
> *****************************************************************
> Failure in example: getinf(b)
> from line #20 of numarray.ieeespecial
> Expected: (array([0, 2]), array([0, 3]))
> Got:
> Out[31]:
> array([[ 999., 1., 2., 3.],
> [ 4., 5., 6., 7.],
> [ 8., 9., 10., 999.],
> [ 12., 13., 14., 15.]])
> *****************************************************************
> Failure in example: a
> from line #26 of numarray.ieeespecial
> Expected:
> array([[ 999., 1., 2., 3.],
> [ 4., 5., 6., 7.],
> [ 8., 9., 10., 999.],
> [ 12., 13., 14., 15.]])
> Got:
> Out[31]: (array([0, 1, 2]), array([1, 2, 3]))
> *****************************************************************
> Failure in example: getnan(a)
> from line #35 of numarray.ieeespecial
> Expected: (array([0, 1, 2]), array([1, 2, 3]))
> Got:
> *****************************************************************
> 1 items had failures:
> 5 of 11 in numarray.ieeespecial
> ***Test Failed*** 5 failures.
> Out[31]: (5, 11)
-- 
From: Darren D. <dd...@co...> - 2004年10月10日 19:47:26
Hello,
I am getting invalid numeric result exceptions when dividing a complex array 
by zero. Is this the desired behavior?
Also, while trying to find a way around the above problem, I ran 
ieeespecial.test and got the following output. I am running numarray 1.1 on 
python 2.3.3. Todd, this might be correlated with the numerix package in 
matplotlib. I tried importing numarray and ieeespecial without matplotlib and 
the ieeespecial.test was successful.
Thanks,
Darren
In [31]: ieeespecial.test()
Out[31]: inf
*****************************************************************
Failure in example:
inf # the repr() of inf may vary from platform to platform
from line #6 of numarray.ieeespecial
Expected: inf
Got:
Out[31]: nan
*****************************************************************
Failure in example:
nan # the repr() of nan may vary from platform to platform
from line #8 of numarray.ieeespecial
Expected: nan
Got:
Out[31]: (array([0, 2]), array([0, 3]))
*****************************************************************
Failure in example: getinf(b)
from line #20 of numarray.ieeespecial
Expected: (array([0, 2]), array([0, 3]))
Got:
Out[31]:
array([[ 999., 1., 2., 3.],
 [ 4., 5., 6., 7.],
 [ 8., 9., 10., 999.],
 [ 12., 13., 14., 15.]])
*****************************************************************
Failure in example: a
from line #26 of numarray.ieeespecial
Expected:
array([[ 999., 1., 2., 3.],
 [ 4., 5., 6., 7.],
 [ 8., 9., 10., 999.],
 [ 12., 13., 14., 15.]])
Got:
Out[31]: (array([0, 1, 2]), array([1, 2, 3]))
*****************************************************************
Failure in example: getnan(a)
from line #35 of numarray.ieeespecial
Expected: (array([0, 1, 2]), array([1, 2, 3]))
Got:
*****************************************************************
1 items had failures:
 5 of 11 in numarray.ieeespecial
***Test Failed*** 5 failures.
Out[31]: (5, 11)
-- 
Darren
From: Alan G I. <ai...@am...> - 2004年10月08日 21:39:04
On 2004年10月08日, John Hunter apparently wrote:
> Could you send some example code when axis is used first with a
> description of what looks wrong to you on the plot?
from scipy import *
from matplotlib.matlab import *
days=arange(31) 
dp = 3 
plot(days,dp*days,'ro')
#produce a zero axis
axis([0,30,-40,100])
axhline(linewidth=0.5,color=(0,0,0))
show()
Version is 0.63.
Ordered as above: axis is not honored.
Switch the order of axis() and axhline(),
and all is well.
Hope that's clear.
Cheers,
Alan
From: John H. <jdh...@ac...> - 2004年10月08日 19:33:46
>>>>> "Alan" == Alan G Isaac <ai...@am...> writes:
 Alan> Unless I send this when I notice it, I'll forget to send it.
 Alan> But I'm not so cold hearted as to hope for any response from
 Alan> John during the early weeks of fatherhood!
No worries - these babies sleep like mad. I get a few minutes a day
to catch up.
 Alan> If a plot makes use of both axhline() and axis(), then
 Alan> axis() must come last or the results are not as expected.
 Alan> Actually I have found it often desirable for axis to come
 Alan> last, but I will simply raise the question of whether this
 Alan> need---possibly surprising to a new user---might be
 Alan> transcended.
Could you send some example code when axis is used first with a
description of what looks wrong to you on the plot?
JDH
From: Yann Le Du <yan...@no...> - 2004年10月08日 15:22:56
On Fri, 8 Oct 2004, John Hunter wrote:
> >>>>> "Yann" == Yann Le Du <yan...@no...> writes:
> 
> Yann> Hello again, I found the solution : in file transforms.py I
> Yann> changed the lines 181-183 by replacing :
> 
> Yann> from _transforms import ...
> 
> It looks like your matplotlib directory is out of whack. You should
> remove the entire build tree and start over. In matplotlib-0.63,
> _transforms.so does not exist; it is replaced by
> _lib/matplotlib/_transforms.py, which imports either the _na or _nc
> version.
> 
> So even though you got it to work, that you had a problem at all
> indicates your src directory is messed up, and so I advise you to get
> a clean start.
Yes indeed, I've removed my site-packages/matplotlib directory and
reinstalled, and it works fine ! I found it strange to be the only one
with that problem, but in fact it's just because others keep things tidier
than I do...
Thanks,
-- 
Yann Le Du
http://www-thphys.physics.ox.ac.uk/users/YannLeDu

Showing results of 120

<< < 1 2 3 4 5 > >> (Page 3 of 5)
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 によって変換されたページ (->オリジナル) /