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






Showing 8 results of 8

From: Tom D. <tom...@gm...> - 2005年07月15日 23:47:26
I am trying to plot multiple values on a date plot. plot allows for
this but plot date tells me it only takes 5 arguments. Is there a
reason for this difference? Am I using the function incorrectly?=20
Does anyone know of a work around? The exception is below:
Extra content at the end of the document
Traceback (most recent call last):
 File "examples/multidate.py", line 68, in ?
 splot2.plot_date(dates1, y1, 'g-', dates2, y2, 'b-')
TypeError: plot_date() takes at most 5 arguments (7 given)
From: Chris B. <Chr...@no...> - 2005年07月15日 21:30:51
I'm not familiar with pygtk.require(), but if it's anything like
wxversion.select()
Don't Get Rid of It!
No matter how hard we all try, packages are not totally backward 
compatible. Having a dependency without any version info in it is the 
road to hard to identify bugs. If matplotlib has been tested only with 
certain versions of pygtk, it's quite reasonable that folks get an error 
message if they try to run it with other versions. To do otherwise would 
be like having a dynamically linked app with non-version dynamic libs.
That being said, perhaps pygtk.require(), or the way it is being used, 
is not very well suited to this task. With wxversion, the select call 
must be made before any imports of wx. Thus, it should only be called in 
__main__. If you have a module (like matplotlib) that has been tested 
against certain versions, you should test for the version by checking 
wx.__version__, rather than calling wxversion.select(). The exception to 
this might be pylab for interactive use, where it is acting as the first 
importer of wx.
So, my suggestion is that if pygtk.require() is causing more trouble 
than it's worth, then figure out how to use it differently, rather than 
scrapping it all together.
-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 G. <jn...@eu...> - 2005年07月15日 20:08:06
Steve Chaplin wrote:
> On Thu, 2005年07月14日 at 10:52 -0700,
> mat...@li... wrote:
> > I notice that pygtk.require('2.0') calls have appeared in
> > backend_gtk.py and backend_gdk.py
> It has not appeared, its been used since matplotlib 0.53 at least,
> probably forever.
>
oops, yes you are right.
I saw a comment in the 0.83 release notes re: pygtk require 2.0 + 
assumed this was what was making my code mis-behave.
it looks like this is the change the release notes were talking about:
< pygtk_version_required = (1,99,16)
---
 >
 > pygtk_version_required = (2,0,0)
<snip>
> I've never liked pygtk.require(), it tries to be clever by editing your
> sys.path to solve one problem, but creates other problems like you 
> describe,
> so on balance you don't gain much, if anything.
>
> The only situation it helps with is when you have pygtk 1 and 2 
> installed on
> the same system AND pygtk 1 is ahead of pygtk 2 in sys.path. I think 
> that is
> increasing rare nowadays.
>
> My vote is to remove it completely.
>
> Steve
>
I'll second that :)
John
From: <and...@ti...> - 2005年07月15日 19:53:03
Hello NG,
 in my application (that is reaching 50,000 lines of code at the momen=
t)
I use wxPython, matplotlib and other useful resources. I am having 2 stra=
nge
behaviors, one related to matplotlib and the other to wxPython.
1) wxPython Problem
When my app starts, it loads a bunch of modules and creates a main wx.Not=
ebook,
with a lot of buttons, grid and textctrls and so on. When it starts, a wx=
.Gauge
+ a Splashscreen inform the user on the loading progress (usually it take=
s
5-6 seconds) and at the end the main frame is shown and maximized.
Well, I have launched the Windows Task Manager to monitor the RAM consupt=
ion.
This is what happens:
a) Loading and showing everything increase the RAM usage to 70 MB (!!!)
BUT;
b) If I minimize the main frame the RAM drops down to 4 MB AND;
c) By re-maximizing the main frame the RAM goes to 7 MB.
Now, if I do some interaction with the wxThings in all the tabs in the wx=
.Notebook,
the RAM keeps increasing. If at a certain point I minimize the main frame=
the RAM goes back to 4 MB and re-maximizing it raises the RAM to 8 MB.
Question: what is going on? Is there something (probably easy) that I am
not aware of on Windows machines? Why the minimize/maximize actions have
this effect? Is there a way to reproduce the effect of minimize/maximize
with actually doing it? May it be a memory leaking problem somewhere?
2) Matplotlib problem
In the same app, I have a wx.Grid in which, by clicking with the right mo=
use
button, a row is selected and a popup menu appears. By choosing the right=
item on this submenu, a frame with a Matplotlib figure (and other small
things) is created. Then I close the frame and I redo the same action. Ev=
ery
time I do this action, it seems that Matplotlib is sucking 4 MB of RAM,
that does not decrease after I have closed the Matplotlib frame.
At a certain point, my app goes over 150 MB of RAM only by having opened/=
closed
some Matplotlib figures. The only solution I found is still to minimize/m=
aximize
the main GUI frame (as in Problem 1).
Question: why the RAM consumption does not decrease when I close the Matp=
lotlib
frame? Shouldn't be the gc that takes care of doing such action?
Thank you *a lot* for every suggestion, comment, opinion.
Sorry for the long post.
Andrea.
From: Noko P. <np...@an...> - 2005年07月15日 07:15:37
Thanks, John. Now works like a charm after checking the recent examples.
 =20
-----Original Message-----
From: John Hunter [mailto:jdh...@ac...]=20
Sent: Thursday, July 14, 2005 7:51 PM
To: Noko Phala
Cc: mat...@li...
Subject: Re: [Matplotlib-users] matplotlib, py2exe import problems
>>>>> "Noko" =3D=3D Noko Phala <np...@an...> writes:
 Noko> Can someone tell me how to successfully create an executable
 Noko> of a script that uses matplotlib? The example script in the
 Noko> documentation does not appear to work for my case. I keep
 Noko> missing modules, and everytime I add the missing module, a
 Noko> new one crops up. Much like the problems listed here:
 Noko>
http://mail.python.org/pipermail/python-list/2005-February/267595.html
 Noko> My recent error message is:
 Noko> Traceback (most recent call last):
 Noko> File "Uranium_Leaching_ Modelv1.py", line 162, in ?
 Noko> File "pylab.pyc", line 1, in ?
 Noko> File "matplotlib\pylab.pyc", line 217, in ?
 Noko> File "matplotlib\backends\__init__.pyc", line 24, in
 Noko> pylab_setup
 Noko> ImportError: No module named backend_tkagg
Which backend do you want to use? Are you using the pylab interface.
It looks like you are getting the default win32 backend backend_tkagg
but you have explicitly excluded it with
 "py2exe": {"excludes": ['_gtkagg', '_tkagg'],
It looks like you are using an old example, because these lines are
not included in the examples pointed to in the FAQ. BTW, I have just
tested and updated the py2exe example zip file so you may want
download it=20
 http://matplotlib.sourceforge.net/faq.html#PY2EXE
 http://matplotlib.sourceforge.net/py2exe_examples.zip
The update includes an example for tkagg in addition to gtkagg and
wxagg.
Note in the current release in matplotlib (0.83.1), before freezing,
you need to replace these lines in
site-packages/matplotlib/numerix/__init__.py
g =3D globals()
l =3D locals()
__import__('ma', g, l)
__import__('fft', g, l)
__import__('linear_algebra', g, l)
__import__('random_array', g, l)
__import__('mlab', g, l)
la =3D linear_algebra
ra =3D random_array
with the following
from matplotlib import FROZEN
if not FROZEN:
 g =3D globals()
 l =3D locals()
 __import__('ma', g, l)
 __import__('fft', g, l)
 __import__('linear_algebra', g, l)
 __import__('random_array', g, l)
 __import__('mlab', g, l)
 la =3D linear_algebra
 ra =3D random_array
because they break py2exe. These lines import the sub-modules of
numerix (fft, ma, mlab, etc) into the numerix namespace. So you can
do for example
import numerix as nx
x =3D nx.mlab.mean( nx.mlab.randn(10000)=20
w/o them you have to explicitly import the submodules. Can anyone
suggest a way to do this that doesn't break py2exe? Apparently py2exe
doesn't handle __import__ very well
---------------------------------------------------------------------------=
---------------
This e-mail was checked by the e-Sweeper Service.
For more information visit our website, Clearswift Corporation e-Sweeper :
http://www.mimesweeper.com/products/esweeper/
---------------------------------------------------------------------------=
---------------
From: Robert K. <rk...@uc...> - 2005年07月15日 06:17:32
N. Volbers wrote:
> Hello everyone,
> 
> I have written an application that depends on matplotlib. My 
> application has several dependencies and I feel like this is a problem. 
> Since matplotlib only depends on Numeric, I would like to have 
> matplotlib linked statically.
There is no such thing as "linking a Python package statically." At 
least, we do not use such terminology.
> I guess I wouldn't have to change much about my program. I would simply 
> replace calls like this
> 
> from matplotlib import *
> 
> by calls like this
> 
> from myapp.matplotlib import *
You *could* put matplotlib wholesale into your package hierarchy 
(indeed, matplotlib does this for at least one of its dependencies), but 
it seems to me better to just package up matplotlib for the platforms 
that you support and distribute that package alongside your own.
There has been some recent work that should make this kind of thing 
very, very easy.
http://peak.telecommunity.com/DevCenter/EasyInstall
Numeric, at least, builds into an egg just fine. matplotlib might take a 
little more work, but John has started to look into it.
> My problem is on the setup side. I have only started to use the 
> distutils and I found they are not-so-well documented. Can anyone 
> provide me with an example or some hints on how to include matplotlib 
> statically?
> 
> My second question is the license question :-) I read through the 
> matplotlib license and there seems to be no problem with including 
> matplotlib. Is that also valid if my program is GPL-licensed?
Yes. The licenses of matplotlib's code are all GPL-compatible as far as 
I can tell.
-- 
Robert Kern
rk...@uc...
"In the fields of hell where the grass grows high
 Are the graves of dreams allowed to die."
 -- Richard Harter
From: N. V. <mit...@we...> - 2005年07月15日 05:47:58
Hello everyone,
I have written an application that depends on matplotlib. My 
application has several dependencies and I feel like this is a problem. 
Since matplotlib only depends on Numeric, I would like to have 
matplotlib linked statically. 
I guess I wouldn't have to change much about my program. I would simply 
replace calls like this
from matplotlib import *
by calls like this
from myapp.matplotlib import *
My problem is on the setup side. I have only started to use the 
distutils and I found they are not-so-well documented. Can anyone 
provide me with an example or some hints on how to include matplotlib 
statically?
My second question is the license question :-) I read through the 
matplotlib license and there seems to be no problem with including 
matplotlib. Is that also valid if my program is GPL-licensed?
With best regards,
Niklas Volbers.
From: Steve C. <ste...@ya...> - 2005年07月15日 02:58:28
On Thu, 2005年07月14日 at 10:52 -0700,
mat...@li... wrote:
> I notice that pygtk.require('2.0') calls have appeared in
> backend_gtk.py and backend_gdk.py
It has not appeared, its been used since matplotlib 0.53 at least,
probably forever.
> I am not convinced that library code should include calls to
> pygtk.require()
> > 
> The problem is that pygtk.require() has to be called >before<
> importing gtk.
> > 
> This means that if you are using gtk then you have two choices:
> > 1. never use pygtk.require()
> > 2. always precede any 'import gtk' with 'import pygtk' and
> > 'pygtk.require('2.0')'
> I have found that 1. works pretty well and prefer not to litter code
> with the pygtk.require() boiler plate.
> > 
> Unfortunately, approach 1. falls over if you use some library that
> decides to use pygtk.require().
> > 
> In the times when I do require a specific version of pygtk then I can
> always create a simple wrapper that does the pygtk require stuff.
> > 
> Now no doubt I'm missing some subtleties as to why it is good to have
> these pygtk.require() calls in matplotlib. Is there any way to make
> them optional?
> > 
> A half-way house would be to do something like this:
> > 
> try:
> import pygtk
> if not matplotlib.FROZEN and not sys.modules.has_key('gtk'):
> pygtk.require('2.0')
> except:
> print >> sys.stderr, sys.exc_info()[1]
> raise SystemExit('PyGTK version %d.%d.%d or greater is required to
> run '
> 'the GTK Matplotlib backends'
> % pygtk_version_required)
> > 
> This code would ensure that the correct pygtk is loaded for people who
> haven't already import'ed gtk without throwing an exception for those
> that have loaded gtk prior to importing matplotlib.
> > 
> The down side with this fix is that it doesn't help anyone who does
> want the pygtk.require() but has made the mistake of importing gtk
> first.
> > 
> Any thoughts?
> > 
> John
I've never liked pygtk.require(), it tries to be clever by editing your 
sys.path to solve one problem, but creates other problems like you describe,
so on balance you don't gain much, if anything.
The only situation it helps with is when you have pygtk 1 and 2 installed on
the same system AND pygtk 1 is ahead of pygtk 2 in sys.path. I think that is
increasing rare nowadays.
My vote is to remove it completely.
Steve
Send instant messages to your online friends http://au.messenger.yahoo.com 

Showing 8 results of 8

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 によって変換されたページ (->オリジナル) /