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

Showing results of 284

1 2 3 .. 12 > >> (Page 1 of 12)
From: Vinj V. <vin...@ya...> - 2005年04月30日 21:45:25
I get the error Cannot combine None with str from line
709 in pylab.py
figimage.__doc__ = Figure.figimage.__doc__ + """
Addition kwargs: hold = [True|False] overrides default
hold state"""
I removed the str part of the line and then get the
following error:
 File
"/usr/lib/python2.3/site-packages/matplotlib/pylab.py",
line 709, in ?
 Figimage.__doc__ = Figure.figimage.__doc__
 NameError: name 'Figimage' is not defined
I saw a reference to this error on the list before but
there was no reference to except turning off optimize
mode. Unfortunately that is not an option in my
production env. Any suggestions??
Thanks,
Vineet
From: Werner F. B. <wer...@fr...> - 2005年04月30日 18:16:45
Hi Michael,
Michael Soulier wrote:
>On 4/29/05, Werner F. Bruhin <wer...@fr...> wrote:
> 
>
>>With wxPython the demo is your friend, it is often a separate download
>>and it contains small to extensive samples for just about every widget.
>> 
>>
>
>I found that the demos were all done with the old namespace setup,
>which is a real pain when the new wx.* setup is now recommended.
> 
>
Are you sure you got the latest demo? I don't have my 2.5 version 
installed anymore as I just got 2.6 the other day, but in 2.6 demo's all 
the ones I looked at use the new namespace.
> 
>
>>There is also a new documenation in the works, not complete, but not bad
>>either look at http://www.wxpython.org/docs/api/
>>
>>If you decide on wxPython you might want to start with 2.6 (which just
>>came out and has some nice things like foldpanel) and you might want to
>>look at Boa Constructor if you like IDE's.
>> 
>>
>
>Well, I'm in a bit of version hell, trying to find versions of every
>package I want that's going to work together, including
>boa-constructor. wxGlade seems nicer to me though, I might try that.
> 
>
Getting all the right versions is not easy. I stayed until recently on 
wxPython 2.4 (one because it is the "stable" release, but also as I 
couldn't get all tools I want to use on 2.5). Only switched to 2.5 a 
couple of month ago, that switch was much easier then I first thought 
and now with 2.6 its even better. Haven't looked at wxGlade for some 
time, but I understand its handling of sizers is more intuative then in 
Boa, but then I am pretty sure Riaan will catch up on this. When I 
started using wxPython I wanted an IDE and not just a GUI generator that 
is why I went with Boa at the time.
>Still, for simple guis Tkinter rocks, it's fast, and it's easy to
>port. Mannings book on it is great, if erroneous in places. Good docs
>are a must.
> 
>
We wx fans are still waiting for THE book (hopefully sometimes this 
year). I agree good docs are a must (also I don't like having to read 
them ;-) ), I don't like the wxWidget stuff as it is in C++ but after a 
while one gets the hang of it, however I find most of the times the 
answer in the demo, or now in the new API docs, or the wiki pages and if 
all that doesn't work someone will help when you post to 
wxP...@li....
>Thanks,
>Mike
>
> 
>
See you and have fun making your choices
Werner
From: Chris B. <Chr...@no...> - 2005年04月29日 22:22:01
Rich Drewes wrote:
> Now, if we could only get this numarray/Numeric mess
> sorted out,
Well, let's all support Travis' "Numeric3" or "SciPy base" or whatever 
it's being called now, project!
> and put a standard array package, and matplotlib, and scipy,
> and a truly portable native GUI into the base Python distribution . . . I
> know, I'm dreaming.
Well, yes, but with the new array protocol, at least we can have all 
those things working well together, if not in the Standard lib.
-Chris
-- 
Christopher Barker, Ph.D.
Oceanographer
 		
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chr...@no...
From: Rich D. <dr...@in...> - 2005年04月29日 21:49:56
Hello,
An article written by me is in the June 2005 Linux Journal. It's about a
Python toolkit I developed for working with spiking neural networks and it
features a plug for matplotlib and some graphs drawn with matplotlib. 
The article is available online now at www.linuxjournal.com (subscribers
only for now, I'll have the article up locally when I am permitted) and
should hit the newsstands in a day or two, if not already.
Thanks to John and everyone for developing great Python scientific tools
like matplotlib! Now, if we could only get this numarray/Numeric mess
sorted out, and put a standard array package, and matplotlib, and scipy,
and a truly portable native GUI into the base Python distribution . . . I
know, I'm dreaming. Keepup the good work at any rate.
Rich
http://www.interstice.com/drewes
From: Chris B. <Chr...@no...> - 2005年04月29日 20:34:22
Michael Soulier wrote:
> Well, I'm in a bit of version hell, trying to find versions of every
> package I want that's going to work together, including
> boa-constructor.
Yes, Boa is kind of behind the times, but I imagine it will catch up soon.
> Still, for simple guis Tkinter rocks, it's fast, and it's easy to
> port.
Port to what?
> Mannings book on it is great,
There is a wxPython book coming out fairly soon, but that doesn't help 
you now.
> Good docs are a must.
Yes, and wxPython has them. It's a little skimpy on the newbie-oriented 
stuff, but between the demo, the reference and the Wiki, there is a lot 
of good stuff there.
We really should make a concerted effort to port the demo to modern 
idioms (including the wx namespace), though I just took a look, and the 
first four items I clicked on were using the wx namespace, so it's not 
so bad!
-Chris
-- 
Christopher Barker, Ph.D.
Oceanographer
 		
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chr...@no...
From: Alan G I. <ai...@am...> - 2005年04月29日 19:10:51
On 2005年4月29日, Michael Soulier apparently wrote: 
> for simple guis Tkinter rocks, it's fast, and it's easy to 
> port. Mannings book on it is great, if erroneous in 
> places. Good docs are a must. 
Do you mean Grayson's book?
Any other recommendations?
Thank you,
Alan Isaac
From: Michael S. <mso...@gm...> - 2005年04月29日 18:42:45
On 4/29/05, Werner F. Bruhin <wer...@fr...> wrote:
> With wxPython the demo is your friend, it is often a separate download
> and it contains small to extensive samples for just about every widget.
I found that the demos were all done with the old namespace setup,
which is a real pain when the new wx.* setup is now recommended.
> There is also a new documenation in the works, not complete, but not bad
> either look at http://www.wxpython.org/docs/api/
>=20
> If you decide on wxPython you might want to start with 2.6 (which just
> came out and has some nice things like foldpanel) and you might want to
> look at Boa Constructor if you like IDE's.
Well, I'm in a bit of version hell, trying to find versions of every
package I want that's going to work together, including
boa-constructor. wxGlade seems nicer to me though, I might try that.
Still, for simple guis Tkinter rocks, it's fast, and it's easy to
port. Mannings book on it is great, if erroneous in places. Good docs
are a must.
Thanks,
Mike
--=20
Michael P. Soulier <mso...@gm...>
http://www.digitaltorque.ca
http://opag.ca python -c 'import this'
From: Yves M. <ym...@gr...> - 2005年04月29日 16:16:53
Hi,
I realize this should be really two posts, but any how here it is :
1) Is there a way people know of integrating Matplotlib into Zope ? I had to
fight with the registry (yes, a windows box for now) to get matplotlib to
install on the right Python (Zope's, not the system Python) but more importantly
I am using an external method to gain access to matplotlib via Zope. It works,
but it's clumsy and I suspect loading up pylab could be quicker if I could use
Scripts (Python) objects in Zope.
As a side question, is there a way not to open a file, e.g. replace the
following lines :
savefig("test.png")
fh = open("C:\\Program Files\\Plone 2\\Data\\bin\\test.png","rb")
data = fh.read()
fh.close()
I had origianlly forgotten to close my file handle connection and it obviously
was a good way to kill my Zope app (laek was about 3 MB a shot!) so avoiding to
write in a file together with a closer integration into Zope would probably make
such memory leaks less susceptible to occur.
2) Is there an example somewhere along the lines of finance.py or
date_demo_rrule.py but with data coming from a postgreSQL 8.0.2 back end ? One
question I have is about the use of DateTime objects with PG queries : can
PL/Python scripts handle DateTime objects directly or do I have to fiddle with 
a combination of num2date and strftime (??) to build a meaningful SQL query? 
Any pointers to example usage appreciated.
Thanx for this great plotting products. I'm looking forward to using more and
more of matplotlib's power! 
Yves Moisan
From: Werner F. B. <wer...@fr...> - 2005年04月29日 16:14:34
Hi Michael,
Michael Soulier wrote:
> On 4/28/05, John Hunter <jdh...@ac...> wrote:
> 
>>Don't use the pylab interface when building moderately complex
>>applications -- use the OO library instead. What GUI toolkit are you
>>using to build your app? See embedding_in_*.py, in the examples
>>directory, where * is the name of your GUI toolkit, eg, tk, gtk, wx
>>etc.
>>
>>See also http://matplotlib.sourceforge.net/faq.html#OO
> 
> 
> Ok, thanks. It's either going to be Tkinter or wxPython. The former is
> easier to use and deploy, but the latter looks slicker and seems to
> have more high-level widgets (poorer docs), and nice tools like
> wxGlade.
With wxPython the demo is your friend, it is often a separate download 
and it contains small to extensive samples for just about every widget.
There is also a new documenation in the works, not complete, but not bad 
either look at http://www.wxpython.org/docs/api/
If you decide on wxPython you might want to start with 2.6 (which just 
came out and has some nice things like foldpanel) and you might want to 
look at Boa Constructor if you like IDE's.
See you
Werner
> 
> Mike
> 
From: Alan G I. <ai...@am...> - 2005年04月29日 15:47:24
On 2005年4月25日, Grig Gheorghiu apparently wrote: 
> http://agiletesting.blogspot.com/2005/04/sparkplot-creating-sparklines-with.html 
Fun and useful.
Thank you!
Alan Isaac
From: Michael S. <mso...@gm...> - 2005年04月29日 13:52:09
On 4/28/05, John Hunter <jdh...@ac...> wrote:
>=20
> Don't use the pylab interface when building moderately complex
> applications -- use the OO library instead. What GUI toolkit are you
> using to build your app? See embedding_in_*.py, in the examples
> directory, where * is the name of your GUI toolkit, eg, tk, gtk, wx
> etc.
>=20
> See also http://matplotlib.sourceforge.net/faq.html#OO
Ok, thanks. It's either going to be Tkinter or wxPython. The former is
easier to use and deploy, but the latter looks slicker and seems to
have more high-level widgets (poorer docs), and nice tools like
wxGlade.
Mike
--=20
Michael P. Soulier <mso...@gm...>
http://www.digitaltorque.ca
http://opag.ca python -c 'import this'
From: John H. <jdh...@ac...> - 2005年04月29日 02:45:45
>>>>> "Michael" == Michael Soulier <mso...@gm...> writes:
 Michael> Hello, I'm writing an app that requires a gui interface
 Michael> that will generate graphs on demand. When one top-level
 Michael> window containing a new graph is created, it should not
 Michael> block the application from making new ones if the user
 Michael> requests one.
 Michael> I can do this myself but I like matplotlib. How could I
 Michael> do this? So far it seems that my app blocks on the show()
 Michael> call, and if I try to make a new graph after that, the
 Michael> whole application locks up and has to be killed.
Don't use the pylab interface when building moderately complex
applications -- use the OO library instead. What GUI toolkit are you
using to build your app? See embedding_in_*.py, in the examples
directory, where * is the name of your GUI toolkit, eg, tk, gtk, wx
etc.
See also http://matplotlib.sourceforge.net/faq.html#OO
Hope this helps,
JDH
From: Michael S. <mso...@gm...> - 2005年04月29日 02:23:52
Hello,
I'm writing an app that requires a gui interface that will generate
graphs on demand. When one top-level window containing a new graph is
created, it should not block the application from making new ones if
the user requests one.
I can do this myself but I like matplotlib. How could I do this? So
far it seems that my app blocks on the show() call, and if I try to
make a new graph after that, the whole application locks up and has to
be killed.
Thanks,
Mike
--=20
Michael P. Soulier <mso...@gm...>
http://www.digitaltorque.ca
http://opag.ca python -c 'import this'
From: Chris B. <Chr...@no...> - 2005年04月28日 17:18:54
Dimitri D'Or wrote:
> I was surprised to discover recently that the RESHAPE function in Python 
> and Matlab do not yield the same result. In fact, Python reshapes along 
> the rows while Matlab does it along the columns.
> Does anyone have an explanation for this?
AFAIK, the reason is that MATLAB has Fortran in it's history, ans thus 
uses Fortran semantics laying out arrays, whereas Numeric and numarray 
use C semantics for laying out arrays.
NumPy is not Matlab, nor is it trying to be.
> Is it possible to change the 
> axis priority like e.g., in concatenate?
It doesn't look like it, from the docs. The reason is that re-shape 
doesn't move any data around in memory, it just changes the way the data 
is interpreted.
What you want really is a transpose, as you've discovered, but think 
about whether you really want that... it might make more sense to just 
stick with NumPy's natural ordering.
This, by the way is a Numeric or numarray question, you'd be best off 
referring to the docs for those packages, and asking questions on the 
numpy-discussion list.
-Chris
-- 
Christopher Barker, Ph.D.
Oceanographer
 		
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chr...@no...
From: John H. <jdh...@ac...> - 2005年04月28日 13:59:44
>>>>> "steve" == steve schmerler <el...@gm...> writes:
 steve> Hi help(plot) states something like
 steve> [...] If you make multiple lines with one plot
 steve> command, the kwargs apply to all those lines, eg plot(x1,
 steve> y1, x2, y2, antialising=False) Neither line will be
 steve> antialiased. [...]
 steve> but the MPL manual says "antialiased" and "aa"
 steve> respectively, which works. "antialising" gives
 steve> TypeError: There is no line property "antialising"
 steve> However, if I set antialising to False in .matplotlibrc or
 steve> try
 steve> plot(...,aa=False)
 steve> nothing happens. The plot is still antialised.
Hmm, you've found two bugs here. First, the docstring is incorrect:
"antialiasing" should read "antialiased". Note you can use the set
command to get the real information, since it actually inspects the
object methods
 >>> line = plot([1,2,3])
 >>> set(line) 
The second bug is that agg is ignoring the aa property. I recently
refactored graphics context property handling in agg and forgot to
call the gc._set_antialiased method in the constructor in
_backend_agg.cpp. This is fixed in CVS.
While I was poking around I also found another bug! In interactive
mode with the TkAgg backend, the draw operation is being called twice
with each plot, halving the performance. Since tk is already pokey,
this is a problem -- and fortunately should be a relatively easy fix.
If you put a print statement in matplotlib.figure.Figure.draw, and
then set interactive : True and backend :TkAgg and fire up a standard
python shell and do
 >>> from pylab import plot
 >>> plot([1,2,3])
You'll see that draw is called twice. We've had a devil of a time
getting the tk stuff just right in backend_tkagg -- it seems like the
same bugs keep recurring in different guises.
We should be able to get this sorted out for a bug-fix release in the
near future, probably next week.
JDH
From: John H. <jdh...@ac...> - 2005年04月28日 13:30:10
>>>>> "Nicolas" == Nicolas CHARVIN <Nic...@un...> writes:
 Nicolas> Hi, I am trying to plot an histogram, but i cannot set
 Nicolas> 'yscale' to 'log'.
matplotlib transfers the vertices of the rectangles that make up the
bar, which by default have their bottom at 0. 
Use the bottom kwarg, eg
 N,b,pb = hist(x, bottom=0.001)
 set(gca(), yscale='log')
See also http://matplotlib.sf.net/examples/log_bar.py
JDH
From: Dimitri D'O. <dim...@fs...> - 2005年04月28日 13:12:56
Hello,
 
I was surprised to discover recently that the RESHAPE function in Python and
Matlab do not yield the same result. In fact, Python reshapes along the rows
while Matlab does it along the columns.
 
For example, the Matlab code:
>> a=(0:19);
>> reshape(a,5,4)
 
ans =
 
 0 5 10 15
 1 6 11 16
 2 7 12 17
 3 8 13 18
 4 9 14 19
 
And the Python equivalent:
>>> a=arange(20)
>>> reshape(a,(5,4))
[[ 0, 1, 2, 3, ]
 [ 4, 5, 6, 7, ]
 [ 8, 9,10,11, ]
 [12,13,14,15,]
 [16,17,18,19,]]
 
To obtain the same result, I should write:
>>> transpose(reshape(a,(4,5)))
 
Does anyone have an explanation for this? Is it possible to change the axis
priority like e.g., in concatenate?
 
Thank you,
 
Dimitri D'Or
From: Nicolas C. <Nic...@un...> - 2005年04月28日 13:05:44
Hi,
I am trying to plot an histogram, but i cannot set 'yscale' to 'log'.
 >>> mu, sigma =3D 100, 15
 >>> x =3D mu + sigma*randn(10000)
 >>> N,b,pb =3D hist(x)
 >>> set(pb, "facecolor", 'r')
 >>> set(gca(), 'yscale', 'log')
 File "C:\Python23\Lib\site-packages\matplotlib\patches.py", line 131, in=
=20
draw
 tverts =3D self._transform.seq_xy_tups(verts)
ValueError: Domain error on nonlinear Transformation::seq_xy_tups=20
operator()(thisx, thisy)
kabang !
Does anybody know what's wrong with this?
Thanks in advance
nicolas
--
Nic...@un...
LMOPS - Lab. Mat=E9riaux Organiques =E0 Propri=E9t=E9s Sp=E9cifiques
B=E2t IUT - Universit=E9 de Savoie
73376 LE BOURGET DU LAC CEDEX
Tel: 04-79-75-86-53
http://www.univ-savoie.fr/labos/lmops
From: steve s. <el...@gm...> - 2005年04月28日 09:35:17
Hi
help(plot) states something like
 [...]
 If you make multiple lines with one plot command, the kwargs apply
 to all those lines, eg
 plot(x1, y1, x2, y2, antialising=False)
 Neither line will be antialiased.
 [...]
but the MPL manual says "antialiased" and "aa" respectively, which works. "antialising" gives
 TypeError: There is no line property "antialising"
However, if I set antialising to False in .matplotlibrc or try
 plot(...,aa=False)
nothing happens. The plot is still antialised.
Cheers,
Steve
-- 
Man is the best computer we can put aboard a spacecraft ... and the only one that can be
mass produced with unskilled labor. - Wernher von Braun
From: Mark E. <ma...@st...> - 2005年04月28日 09:03:15
Sorry - problem solved. I was 0.01 versions behind on the computer I 
was using. Thanks for adding such a great feature!
- Mark
On Apr 28, 2005, at 1:43 AM, Mark Engelhardt wrote:
> Hi,
>
> I am trying to construct coloured contour maps, but when I do:
>
> from pylab import *
>
> clabel is not there. Was this removed? The docs suggest that clabel 
> is part of the pylab module.
>
> thanks,
> Mark
>
>
>
> -------------------------------------------------------
> SF.Net email is sponsored by: Tell us your software development plans!
> Take this survey and enter to win a one-year sub to SourceForge.net
> Plus IDC's 2005 look-ahead and a copy of this survey
> Click here to start! http://www.idcswdc.com/cgi-bin/survey?id=105hix
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
........................................................................ 
.....
Mark Engelhardt
Pande and Herschlag groups
S257 Clarke Center, 318 Campus Drive
Stanford University, Stanford, CA 94305
ma...@st...
http://www.stanford.edu/~marke/
From: Mark E. <ma...@st...> - 2005年04月28日 08:43:41
Hi,
I am trying to construct coloured contour maps, but when I do:
from pylab import *
clabel is not there. Was this removed? The docs suggest that clabel 
is part of the pylab module.
thanks,
Mark
From: Karsten W. J. <kw...@fy...> - 2005年04月28日 06:37:38
Dear John,
Thanks for the help. Now it works!
Karsten.
On Tue, 2005年04月26日 at 20:38 -0500, John Hunter wrote:
> >>>>> "Karsten" == Karsten Wedel Jacobsen <kw...@fy...> writes:
> 
> Karsten> After that the build and install went smoothly. But now
> Karsten> if I try to import pylab I get the following error:
> Karsten> pixbuf_get_pixels_array ImportError: No module named
> Karsten> _nc_backend_gdk
> 
> Karsten> As far as I can see it is still trying to use some
> Karsten> gtk-stuff?
> 
> This is a bit of annoyance in the mpl setup. The backend that is
> chosen at runtime is determined by the rc file (see
> http://matplotlib.sf.net/.matplotlibrc) and the default backend in the
> rc file is GTKAgg. Even if you turn GTK compilation off in setup.py,
> the rc file still determines which backend is selected. You need to
> copy that file from its default location (eg
> /usr/share/matplotlib/.matplotlibrc) to your HOME directory and edit
> the 'backend' setting to something else, eg TkAgg, WXAgg or QtAgg.
> 
> While debugging, it is helpful to create a simple script like
> 
> import pylab
> pylab.plot([1,2,3])
> pylab.show()
> 
> and run it with 
> 
> > python myscript.py --verbose-helpful
> 
> which will show you which rc file is being loaded, which backend is
> selected, what mpl version you are using, and so on.
> 
> 
> Should help,
> JDH
> 
> PS: the bug in pygtk2.4 in fedora core 3 is quite ease to fix. You
> simply have to replace typename with another name like typename_ or
> some other name as described in the FAQ.
From: Chris B. <Chr...@no...> - 2005年04月28日 04:18:34
Rich Drewes wrote:
> That said, since my script never actually tried to do some display, it
> would be spiffy if matplotlib postponed any X oriented stuff that accesses
> the display until the user actually requests a show(). That way, if the
> script just does a savefig(.ps) at the end as mine did, things would Just
> Work.
I'm just guessing here, but I bet the problem comes up when importing 
pylab, not matplotlib. The pylab interface was designed to be an easy to 
use interface for interactive use, ala Matlab. It therefor is expecting 
to display stuff. For scripts that generate figures for printing or web 
apps, or whatever, pylab is not really the best option.
That being said, most of the effort towards usability has goine into the 
pylab module, so there is alot of stuff that is easier to do that way. I 
ahev a goal to create a nice pythonic, OO interface for use in scripting 
(and would be bad in interactive use either), but haven't really had a 
chance to work on it. Mostly what it would require is to write helpful 
handy mnethods that do the things that the pylab procedural interface 
already does. So far all I've done is make a few suggestions, some of 
which John has implimented.
In the meantime, I use the matplotlib.use() function, and use pylab when 
I need to.
-Chris
-Chris
From: Ted D. <ted...@jp...> - 2005年04月28日 03:02:58
What was the backend set to?
We've seen messages like this from the Qt library (just in our normal C++ 
work). Qt needs to connect to an X server before it can do pretty much 
anything (I presume that it needs fonts, colors, etc). Just importing some 
of the backends may build certain objects (like QApplication in the case of 
Qt) which may need an X server.
I realize this doesn't actually help you - it's more of an explanation. If 
it is Qt that you're using and this is the cause (neither of which I'm sure 
of), there may not be a good fix. In our application we tried building the 
QApplication with the GUI flag set to false (which stops the X server 
connection) but then if someone tries to do display anything it core dumps 
- not a very good behavior.
Ted
At 07:04 PM 4/27/2005, Darren Dale wrote:
>Hi Rich,
>
>What happens if you run the script on a windows machine, no ssh?
>
>Darren
>
>
>On Wednesday 27 April 2005 9:28 pm, Rich Drewes wrote:
> > I should add that we were both ssh'd into a Linux machine, he from Windows
> > and I from Linux. So his DISPLAY was not set and mine was. When he ran
> > the script it failed for him, but worked for me, even though the script
> > only did a savefig and never tried to actually show() anything to a
> > screen. Is that expected behavior?
> >
> > Rich
> >
> > On 2005年4月27日, Rich Drewes wrote:
> > > Hello,
> > >
> > > I gave a colleague a matplotlib script that generated a .ps output with
> > > savefig, and was surprised when it didn't work for him. I eventually
> > > figured out that since he was a Windows user and didn't have DISPLAY set,
> > > the import of the matplotlib libraries was failing with the error in this
> > > message's subject. I eventually solved the problem by doing
> > > "matplotlib.use('PS')" before the pylab import.
> > >
> > > However, the script never tried to actually display anything, it only
> > > created the plot and did a savefig at the end. So my question is: is
> > > this "could not open display" behavior at import the way things are
> > > supposed to work, or is this a bug? It seems like it would be better to
> > > hold off on the "could not open display" error until someone actually
> > > tried to display something, and if all they did was savefigs, everything
> > > would work fine.
> > >
> > > This is on matplotlib .80.
> > >
> > > Thanks,
> > > Rich
> > >
> > >
> > > -------------------------------------------------------
> > > SF.Net email is sponsored by: Tell us your software development plans!
> > > Take this survey and enter to win a one-year sub to SourceForge.net
> > > Plus IDC's 2005 look-ahead and a copy of this survey
> > > Click here to start! http://www.idcswdc.com/cgi-bin/survey?id=105hix
> > > _______________________________________________
> > > Matplotlib-users mailing list
> > > Mat...@li...
> > > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> >
> > -------------------------------------------------------
> > SF.Net email is sponsored by: Tell us your software development plans!
> > Take this survey and enter to win a one-year sub to SourceForge.net
> > Plus IDC's 2005 look-ahead and a copy of this survey
> > Click here to start! http://www.idcswdc.com/cgi-bin/survey?id=105hix
> > _______________________________________________
> > Matplotlib-users mailing list
> > Mat...@li...
> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>--
>Darren S. Dale
>
>Bard Hall
>Department of Materials Science and Engineering
>Cornell University
>Ithaca, NY. 14850
>
>dd...@co...
>
>
>-------------------------------------------------------
>SF.Net email is sponsored by: Tell us your software development plans!
>Take this survey and enter to win a one-year sub to SourceForge.net
>Plus IDC's 2005 look-ahead and a copy of this survey
>Click here to start! http://www.idcswdc.com/cgi-bin/survey?id=105hix
>_______________________________________________
>Matplotlib-users mailing list
>Mat...@li...
>https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Rich D. <dr...@in...> - 2005年04月28日 02:54:58
On 2005年4月27日, Darren Dale wrote:
> What happens if you run the script on a windows machine, no ssh?
I don't have any Windows machines to test on :)
Based on what John said, I'd guess that the backend would be defaulted to 
some appropriate Windows backend, and things would work. It was only this 
particular combination of ssh'ing in to an X based system that failed from 
Windows.
That said, since my script never actually tried to do some display, it
would be spiffy if matplotlib postponed any X oriented stuff that accesses
the display until the user actually requests a show(). That way, if the
script just does a savefig(.ps) at the end as mine did, things would Just
Work.
Rich
2 messages has been excluded from this view by a project administrator.

Showing results of 284

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