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

Showing results of 356

<< < 1 .. 4 5 6 7 8 .. 15 > >> (Page 6 of 15)
From: John H. <jd...@gm...> - 2008年02月20日 13:19:43
On Feb 20, 2008 6:30 AM, Nick Granger-Brown
<Nic...@xy...> wrote:
>
>
> I would like to plot two or three graphs as subplots in a figure and control
> the axes such that when one graph is zoomed the others are adjusted too. I
> was hoping there would be a notification mechanism which would allow me to
> catch a rescaling of one subplot and redraw the others in step. Can anyone
> suggest a method of doing this?
ax1 = fig.add_subplot(211)
ax1.plot(something)
ax2 = fig.add_subplot(212, sharex=ax1) # ditto for sharey
ax2.plot(something_else)
JDH
From: Michael D. <md...@st...> - 2008年02月20日 13:19:14
Yeah -- the hinting doesn't seem work very well with the STIX fonts. I 
may need to expose an option in the font backend to turn hinting off.
Thanks for the report,
Mike
Bernhard Voigt wrote:
> Hi!
> 
> Using the STIX fonts, the baseline of mathtext glyphs is corrupt using 
> screen backands like GTK or TK. The problem does not appear using the ps 
> or pdf backend.
> Attached is png and eps file of a semilogy plot with a mathtext xlabel. 
> The ytick labes and the xlabel are skrewed in the png.
> 
> Best wishes! Bernhard
> 
> ------------------------------------------------------------------------
> 
> 
> ------------------------------------------------------------------------
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
From: Gary R. <gr...@bi...> - 2008年02月20日 12:56:07
Just an idea: Maybe you could also auto cycle between dash types if only 
the colour and not the dash type is specified in a plot command. The 
gnuplot default would be one model, or the predefined patterns in 
CorelDraw or Inkscape etc. Personally I don't see this as a high 
priority though.
Gary R.
From: Nick Granger-B. <Nic...@xy...> - 2008年02月20日 12:30:56
I would like to plot two or three graphs as subplots in a figure and
control the axes such that when one graph is zoomed the others are
adjusted too. I was hoping there would be a notification mechanism
which would allow me to catch a rescaling of one subplot and redraw the
others in step. Can anyone suggest a method of doing this?
 
Nick Granger-Brown
 
______________________________________________________________________
This email may contain privileged or confidential information, which should only be used for the purpose for which it was sent by Xyratex. No further rights or licenses are granted to use such information. If you are not the intended recipient of this message, please notify the sender by return and delete it. You may not use, copy, disclose or rely on the information contained in it.
Internet email is susceptible to data corruption, interception and unauthorised amendment for which Xyratex does not accept liability. While we have taken reasonable precautions to ensure that this email is free of viruses, Xyratex does not accept liability for the presence of any computer viruses in this email, nor for any losses caused as a result of viruses.
Xyratex Technology Limited (03134912), Registered in England & Wales, Registered Office, Langstone Road, Havant, Hampshire, PO9 1SA.
The Xyratex group of companies also includes, Xyratex Ltd, registered in Bermuda, Xyratex International Inc, registered in California, Xyratex (Malaysia) Sdn Bhd registered in Malaysia, Xyratex Technology (Wuxi) Co Ltd registered in The People's Republic of China and Xyratex Japan Limited registered in Japan.
______________________________________________________________________
From: <kc1...@ya...> - 2008年02月20日 11:51:29
I *finally* got this to work!!! 
Thanks to Werner's message, I found the culpit: the
matplotlibrc file copied to the dist directory
contains the TkAgg backend. All I had to do is to
change *that* file to say:
backend : WXAgg
Note that it's not the matplotlibrc in the installed
copy - but the one in the resulting dist directory.
In addition, I have to do a:
 set MATPLOTLIBDATA=.\mpl-data
before I start the exe file. I don't know why this is
necessary because the code for _get_data_path appears
to look at that directory by default but if I don't
set this, it can't find the data files.
In any event, it works now - after bumping head for 2
weeks!
Thanks everybody.
> -----Original Message-----
> From: Werner F. Bruhin
[mailto:wer...@fr...] 
> Sent: Wednesday, February 20, 2008 1:45 AM
> To: kc1...@ya...
> Cc: mat...@li...
> Subject: Re: [Matplotlib-users] MatPlotLib + Py2exe,
backend problems ...
> 
> 
> Hi,
> 
> kc1...@ya... wrote:
> > So, do I understand this correctly:
> >
> > In order to get rid of the Tkinter problem when
> > building a matplotlib application using py2exe, I
need
> > 0.91.2 ver of matplotlib and use the setup.cfg
file to
> > select the backend I want (wxpython in my case). 
Then
> > run py2exe to build the ap. Correct?
> > 
> I haven't tried it with 0.91.x but with 0.90 I used
a 
> matplotlib exe installer for Windows and I can
create a 
> distribution of my application with py2exe which
does NOT 
> contain tkinter.
> 
> > But then, as I posted earlier, this create a new
> > problem for me in that py2exe says it can't find
wxmsw26uh_vc.dll - 
> > even though the file exists.
> > 
> That dll should no longer be needed by matplotlib. 
Obviously 
> if you use a wxPython build you will get the it,
i.e. I am on 
> 2.8 so I have a bunch of "wxmsw26uh???.dll" files
in my dist folder.
> > What I need is a version of 0.91.2 ver of
matplotlib
> > that works with Python 2.3 to see if that works,
or I
> > guess I would include Tkinter with my exe?
> > 
> There was another message from Stef which might be
the 
> explanation, the default matplotlibrc file is
defining TKAgg 
> as the default backend, so change it to the
following:
> 
> backend : WXAgg
> numerix : numpy # numpy, Numeric or numarray
> 
> 
> Werner
> 
--
John Henry
From: Werner F. B. <wer...@fr...> - 2008年02月20日 09:45:34
Hi Robin and Stef,
Robin wrote:
> ....
> This is a binary distribution, that is one that has already been
> compiled on a different machine. This won't have the setup.cfg file,
> since it is a file that is used to configure the compilation process
> of matplotlib. Also this is why you can only use this distribution
> with specific versions of python, wx etc.
> 
I am under the impression that as of mpl 0.9x there is NO specific
version dependency for wxPython. I believe there was some optimization
code which forced a dependency on wxPython 2.6 Unicode for the wxAgg
backend.
Werner
From: Werner F. B. <wer...@fr...> - 2008年02月20日 09:45:27
Stef,
Stef Mientki wrote:
> ...
> btw, i just saw this on "matplotlibrc"
> #### CONFIGURATION BEGINS HERE
> # the default backend; one of GTK GTKAgg GTKCairo FltkAgg QtAgg TkAgg
> # WX WXAgg Agg Cairo GD GDK Paint PS PDF SVG Template
> backend : TkAgg
> numerix : numpy # numpy, Numeric or numarray
>
> 
I think this is your problem, I have:
backend : WXAgg
numerix : numpy # numpy, Numeric or numarray
Hope this gets it cleared.
Werner
From: Werner F. B. <wer...@fr...> - 2008年02月20日 09:45:26
Hi,
kc1...@ya... wrote:
> So, do I understand this correctly:
>
> In order to get rid of the Tkinter problem when
> building a matplotlib application using py2exe, I need
> 0.91.2 ver of matplotlib and use the setup.cfg file to
> select the backend I want (wxpython in my case). Then
> run py2exe to build the ap. Correct?
> 
I haven't tried it with 0.91.x but with 0.90 I used a matplotlib exe
installer for Windows and I can create a distribution of my application
with py2exe which does NOT contain tkinter.
> But then, as I posted earlier, this create a new
> problem for me in that py2exe says it can't find
> wxmsw26uh_vc.dll - even though the file exists.
> 
That dll should no longer be needed by matplotlib. Obviously if you use
a wxPython build you will get the it, i.e. I am on 2.8 so I have a bunch
of "wxmsw26uh???.dll" files in my dist folder.
> What I need is a version of 0.91.2 ver of matplotlib
> that works with Python 2.3 to see if that works, or I
> guess I would include Tkinter with my exe?
> 
There was another message from Stef which might be the explanation, the
default matplotlibrc file is defining TKAgg as the default backend, so
change it to the following:
backend : WXAgg
numerix : numpy # numpy, Numeric or numarray
Werner
From: <kc1...@ya...> - 2008年02月20日 00:41:54
Michael,
I am referring to the fact that there are no Windows
binaries provided for Python 2.3. If I simply copy
the matplotlib directory over to Python23, py2exe will
get confused.
I have no clue how to build it for Python23. I don't
even have any C compiler.
> -----Original Message-----
> From: Michael Droettboom [mailto:md...@st...] 
> Sent: Tuesday, February 19, 2008 12:19 PM
> To: kc1...@ya...
> Cc: mat...@li...
> Subject: Re: [Matplotlib-users] MatPlotLib + Py2exe,
backend problems ...
> 
> 
> kc1...@ya... wrote:
> > What I need is a version of 0.91.2 ver of
matplotlib
> > that works with Python 2.3 to see if that works...
> 
> I might be misremembering, but I thought 0.91.2
worked with 
> Python 2.3. 
> I don't use 2.3 every day, however. Can you send
the 
> errors that are 
> produced when you build or run matplotlib 0.91.2
with Python 2.3? Or 
> are you just referring to the fact that there are no
Windows binaries 
> provided for Python 2.3?
> 
> Cheers,
> Mike
> 
> -- 
> Michael Droettboom
> Science Software Branch
> Operations and Engineering Division
> Space Telescope Science Institute
> Operated by AURA for NASA
> 
--
John Henry
From: Michael D. <md...@st...> - 2008年02月19日 20:19:33
kc1...@ya... wrote:
> What I need is a version of 0.91.2 ver of matplotlib
> that works with Python 2.3 to see if that works...
I might be misremembering, but I thought 0.91.2 worked with Python 2.3. 
 I don't use 2.3 every day, however. Can you send the errors that are 
produced when you build or run matplotlib 0.91.2 with Python 2.3? Or 
are you just referring to the fact that there are no Windows binaries 
provided for Python 2.3?
Cheers,
Mike
-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
From: <kc1...@ya...> - 2008年02月19日 20:13:12
So, do I understand this correctly:
In order to get rid of the Tkinter problem when
building a matplotlib application using py2exe, I need
0.91.2 ver of matplotlib and use the setup.cfg file to
select the backend I want (wxpython in my case). Then
run py2exe to build the ap. Correct?
But then, as I posted earlier, this create a new
problem for me in that py2exe says it can't find
wxmsw26uh_vc.dll - even though the file exists.
What I need is a version of 0.91.2 ver of matplotlib
that works with Python 2.3 to see if that works, or I
guess I would include Tkinter with my exe?
Do I understand all these correctly?
> -----Original Message-----
> Here was the solution:
> Ok I updated MatPlot from version from 0.87.7 to
0.91.2
> 
> 
> cheers,
> Stef
> 
> 
--
John Henry
From: Robin <ro...@gm...> - 2008年02月19日 19:24:59
I'm not an expert but I thought I'd try and help...
On Feb 19, 2008 7:15 PM, Stef Mientki <ste...@gm...> wrote:
> > where you got it from,
> probably: http://sourceforge.net/project/showfiles.php?group_id=80706
> matplotlib-0.91.2.win32-py2.4.exe
This is a binary distribution, that is one that has already been
compiled on a different machine. This won't have the setup.cfg file,
since it is a file that is used to configure the compilation process
of matplotlib. Also this is why you can only use this distribution
with specific versions of python, wx etc.
If you choose to compile matplotlib yourself, then you have the option
of completely disabling some of the backends, which is done via a
setting in the setup.cfg file.
I am not sure how easy it is to build matplotlib on windows, but on
other platforms it is relatively straightforward.
After obtaining the source distribution, ensure you have the
requirements (including any development files) for the backends you
want. Select the backends to build in setup.cfg and run
python setup.py build
followed by
python setup.py install
Hope this at least clears up the missing setup.cfg issue...
Robin
From: Stef M. <ste...@gm...> - 2008年02月19日 19:23:48
hi John,
kc1...@ya... wrote:
> With Stef's help, I was able to get pass the
> "Matplotlib datafile not found" problem in using
> py2exe and Matplotlib under Python 2.3 - but then ran
> into the same Tkinter not loaded problem like he did.
>
> After reading Stef's messages from this list, I
> downloaded the latest version of Matplotlib - only to
> find that Python 2.3 is no longer supported. So, I
> loaded up Python 2.5 and ran the setup script for
> Py2exe. Now, py2exe is unable to find
> wxmsw26uh_vc.dll - eventhough I have wxPython 2.8
> installed. So, I dug up a copy of wxPython 2.6 and
> have that installed. The file is now there but py2exe
> still can't find it.
>
> This is very fustrating!
>
> 
and it's even more frustrated that was discussed recently in again 
another list (wxPython-list) ;-)
Here was the solution:
Ok I updated MatPlot from version from 0.87.7 to 0.91.2
cheers,
Stef
From: Stef M. <ste...@gm...> - 2008年02月19日 19:14:55
hi John,
John Hunter wrote:
> On Feb 18, 2008 1:11 PM, Stef Mientki <s.m...@ru...> wrote:
>
> 
>> What is setup.cfg, where can I find it and where can I get information
>> about it ?
>> 
>
> Let's keep this on matplotlib-users so we don't annoy the good folks
> at the wxpython and distutils lists...
> 
If you google for this problem you will be surprised how many people 
bump into these two problem,
( matplot datafiles and the tk-issue )
But ok, let's first find the solution ;-)
> setup.cfg is a build/configure file that ships w/ matplotlib in recent
> versions (0.91.x). If it is not in your source distribution, let us
> know which distro you are using, 
__version__ = '0.91.2'
__revision__ = '$Revision: 4802 $'
__date__ = '$Date: 2008年01月06日 12:10:34 -0500 (Sun, 6 Jan 2008) $'
> where you got it from,
probably: http://sourceforge.net/project/showfiles.php?group_id=80706
matplotlib-0.91.2.win32-py2.4.exe
> what you have
> already, etc....
Although I don't see how this can delete a setup.cfg from matplotlib, ..
Windows XP, SP2
Python 2.4
Scipy (enthought edition), with a crashed update through eggs enstaller 
:-(, but everything stiil seems to work fine
wxPython 2.8 msw ansi
btw, i just saw this on "matplotlibrc"
#### CONFIGURATION BEGINS HERE
# the default backend; one of GTK GTKAgg GTKCairo FltkAgg QtAgg TkAgg
# WX WXAgg Agg Cairo GD GDK Paint PS PDF SVG Template
backend : TkAgg
numerix : numpy # numpy, Numeric or numarray
cheers,
Stef
> Among other things, it lets you conditionally turn
> of/off builds of certain GUI backends and other optional features.
>
> JDH
>
>
> 
From: <kc1...@ya...> - 2008年02月19日 19:01:32
With Stef's help, I was able to get pass the
"Matplotlib datafile not found" problem in using
py2exe and Matplotlib under Python 2.3 - but then ran
into the same Tkinter not loaded problem like he did.
After reading Stef's messages from this list, I
downloaded the latest version of Matplotlib - only to
find that Python 2.3 is no longer supported. So, I
loaded up Python 2.5 and ran the setup script for
Py2exe. Now, py2exe is unable to find
wxmsw26uh_vc.dll - eventhough I have wxPython 2.8
installed. So, I dug up a copy of wxPython 2.6 and
have that installed. The file is now there but py2exe
still can't find it.
This is very fustrating!
> Date: 2008年2月18日 21:09:07 -0600
> From: "John Hunter" <jd...@gm...>
> Subject: Re: [Matplotlib-users] [wxPython-users] Re:
MatPlotLib +
> 	Py2exe,	backend problems ...
> To: "Stef Mientki" <s.m...@ru...>
> Cc: mat...@li...
> Message-ID:
> 
<88e...@ma...>
> Content-Type: text/plain; charset=ISO-8859-1
> 
> On Feb 18, 2008 1:11 PM, Stef Mientki
<s.m...@ru...> wrote:
> 
> > What is setup.cfg, where can I find it and where
can I get 
> information 
> > about it ?
> 
> Let's keep this on matplotlib-users so we don't
annoy the 
> good folks at the wxpython and distutils lists...
> 
> setup.cfg is a build/configure file that ships w/
matplotlib 
> in recent versions (0.91.x). If it is not in your
source 
> distribution, let us know which distro you are
using, where 
> you got it from, what you have already, etc.... 
Among other 
> things, it lets you conditionally turn of/off builds
of 
> certain GUI backends and other optional features.
> 
> JDH
> 
> 
> 
> ------------------------------
> 
--
John Henry
From: John H. <jd...@gm...> - 2008年02月19日 15:24:26
On Feb 19, 2008 9:13 AM, Alan G Isaac <ai...@am...> wrote:
> Of course you can do something like this::
>
> from itertools import cycle
>
> mystyles = ['r+-', 'b.--', 'go-.'] #etc
> ax1styles = cycle( mystyles )
You can also cycle through the list matplotlib uses
 import matplotlib.lines as lines
 # filled markers
 fmarkers = lines.Line2D.filled_markers
 # all markers
 markers = lines.Line2D.markers.keys()
but this is not ideal, since lines.Line2D.markers is a dictionary and
the keys will come back un-ordered. Noone has every asked for
auto-marker cycling before, but it might be a good idea and wouldn't
be too hard to add.
JDH
From: Alan G I. <ai...@am...> - 2008年02月19日 15:12:02
On 2008年2月19日, Neal Becker apparently wrote:
> IIUC, in order to have each line with distinct line style, I have to 
> explicitly set the line style. I want pylab to just choose them, just as 
> it does for colors. 
Well, pylab does choose: it varies color and not the dash 
pattern in order to have distinct lines.
I think what you are wanting is something like the 
following: have pylab/pyplot cycle automatically through 
a set of preset Line2D property combinations, when an axes
plots multiple lines.
I think the answer is: this is not available in the
form you want. (Indeed, it is hard for me to imagine
agreement on "nice" choices for multiple properties.)
Of course you can do something like this::
 from itertools import cycle
 mystyles = ['r+-', 'b.--', 'go-.'] #etc
 ax1styles = cycle( mystyles )
 for x,y in data:
 ax1.plot(x, y, ax1styles.next())
Cheers,
Alan Isaac
From: John H. <jd...@gm...> - 2008年02月19日 14:48:52
On Feb 19, 2008 8:37 AM, Leif Oppermann <lx...@cs...> wrote:
> from pylab import *
> import gc
> for i in range (1000):
> A=rand(1024,1024)
> im = imshow(A)
> #del A #doesn't help
> #del im #doesn't help
> #print gc.garbage # no garbage
matplotlib overplots by default -- try setting
 hold(False)
before your loop, and call gc.collect() occassionally
eg
 if (i%100)==0: gc.collect()
JDH
From: Leif O. <lx...@Cs...> - 2008年02月19日 14:38:02
Dear all,
I ran into a memory problem when trying to draw a few hundred png files 
using one imshow per file. The problem can be boiled down to the 
attached code which eats my memory very quickly until Python bombs out. 
I tried to "del" objects after their use, looked for garbage and read 
the user manual, but no luck. Did I do anything wrong or is this a 
memory leak?
Cheers,
Leif
# discovered odd behaviour in relation to the imshow function
# memory usage will go up quickly until the runtime breaks
# watch it with the task manager
# lxo, 19.02.2008
# running matplotlib-0.91.2.win32-py2.5.exe with wxPython 2.8.4.0 on 
Python 2.5.1
from pylab import *
import gc
for i in range (1000):
 A=rand(1024,1024)
 im = imshow(A)
 #del A #doesn't help
 #del im #doesn't help
 #print gc.garbage # no garbage
This message has been checked for viruses but the contents of an attachment
may still contain software viruses, which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.
From: John H. <jd...@gm...> - 2008年02月19日 13:56:46
On Feb 19, 2008 3:32 AM, sa6113 <s.p...@gm...> wrote:
>
> I am writting an application that evaluate curve fit and draw its plot in a
> GUI , I want to draw or show the plot on the GUI not on the pop up window,
> but I don't want to save the figure in first step , user just enter an order
> for the curve fit and see their plots on the main window (GUI) .
> How can I use pylab for this purpose , does it return and QImage object for
> exm. ?
In addition to the tutorial Alan pointed out to you, take a look at
http://matplotlib.sourceforge.net/examples/embedding_in_qt.py
http://matplotlib.sourceforge.net/examples/embedding_in_qt4.py
and
http://matplotlib.sf.net/faq.html#OO
JDH
Chris Kennedy wrote:
> hi Mike,
> 
> I was able to get it to work using:
> 
> reload(matplotlib)
> matplotlib.use('Agg')
That suggests that the bug is somehow related to GUI code. As John 
pointed out, we'll want to very exactly which GUI backend is being used.
> I'll have to beat on it some more to see if this is robust.
> 
> I saw the error message in this code:
> 
> http://search.cpan.org/src/NI-S/Tk-804.027/pTk/mTk/win/tkWinDraw.c
> 
> if(!bitmap) {
> panic("Fail to allocate bitmap\n");
> DeleteDC(dcMem);
> TkWinReleaseDrawableDC(d, dc, &state);
> return;
> }
That seems to suggest that the TkAgg backend (or Tkinter itself) is 
somehow the problem, assuming Gtk doesn't issue the same message (unlikely).
Thanks. Please let us know what other clues you can collect.
Cheers,
Mike
> Michael Droettboom wrote:
>> Can you provide the full traceback for the error? Are there no Python 
>> line numbers etc.?
>>
>> I don't see the string "Fail to allocate bitmap" or "Unable to free 
>> colormap..." anywhere in the matplotlib source, so it's hard to say 
>> where it's coming from. I suspect they are coming from the GUI 
>> framework you are using...
>>
>> If you put your simple example inside of a loop, does the error 
>> eventually occur -- or only within the context of your app? If the 
>> latter, we'll need to somehow narrow it down to a specific setting or 
>> method that causes the problem.
>>
>> Also, what backend are you using when it breaks? Just Agg, or one of 
>> the Gui+Agg backends?
>>
>> Cheers,
>> Mike
>>
>> Chris Kennedy wrote:
>>> hi,
>>> I get this error when I'm generating numerous .png files using 
>>> matplotlib 0.9.2 in py2.4 on WinXP
>>> -----------------------------
>>> Fail to allocate bitmap
>>>
>>> This application has requested the Runtime to terminate it in an 
>>> unusual way.
>>> Please contact the application's support team for more information.
>>> Unable to free colormap, palette is still selected.
>>>
>>> This application has requested the Runtime to terminate it in an 
>>> unusual way.
>>> Please contact the application's support team for more information.
>>> -----------------------------
>>>
>>> The code is simple:
>>> import matplotlib
>>> import matplotlib.pyplot as pylab
>>>
>>> pylabFigure = pylab.figure()
>>> pylabFigure.clf()
>>> pylab.rcdefaults()
>>> pylab.plot(p[0::2], p[1::2], 'b-', linewidth=3)
>>> pylab.title('Endpointing Plot for '+StepMillName)
>>> pylab.xlabel('Mill Distance ('+m_unit+')')
>>> pylab.ylabel('~ Electron response ~' )
>>> pylab.grid(True)
>>> pylabFigure.savefig('EPP_'+StepMillName+'.png', 
>>> facecolor='lightgrey', edgecolor='w')
>>> pylab.close('all')
>>> pylabFigure = None
>>>
>>> I can put this code in a simple program and generate many images 
>>> without seeing the allocate bitmap error.
>>>
>>> Perhaps it is colliding with something else in my main app. Is there 
>>> a command that can clear, flush, or unselect the palette and/or 
>>> colormap?
>>>
>>> I don't see the allocate error if I switch the backend to 'SVG', that 
>>> has it own set of issues though: telling me it can't use, but then 
>>> generating SVG files anyway.
>>>
>>> thanks
>>>
>>
> 
-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
From: Alan G I. <ai...@am...> - 2008年02月19日 13:09:40
On 2008年2月18日, apparently wrote:
> I am writting an application that evaluate curve fit and 
> draw its plot in a GUI , I want to draw or show the plot 
> on the GUI not on the pop up window, but I don't want to 
> save the figure in first step , user just enter an order 
> for the curve fit and see their plots on the main window 
> (GUI) . How can I use pylab for this purpose , does it 
> return and QImage object for exm. ? 
I believe John already told you this: do NOT use pylab.
See <URL:http://matplotlib.sourceforge.net/leftwich_tut.txt>
and the other resources that have been posted on this list.
Cheers,
Alan Isaac
From: Neal B. <ndb...@gm...> - 2008年02月19日 12:39:28
Alan G Isaac wrote:
> On 2008年2月14日, Neal Becker apparently wrote:
>> Can I get nice default line styles and markers,
>> automatically set up with matching legend? Automatically
>> chosen? I don't want to have to go through and manually
>> choose each marker and line style.
> 
> Well, you have to ask for a legend, but everything else
> default looks good to me. What is an example where you do
> not like the default behavior?
> 
> Are you trying to make a bunch of figures look alike?
> 
IIUC, in order to have each line with distinct line style, I have to
explicitly set the line style. I want pylab to just choose them, just as
it does for colors.
From: Larsen, J. <jl...@dm...> - 2008年02月19日 12:35:59
Hi,
When I try to plot a time series of numpy masked array data containing 2 values and with one of them masked out my machine chokes (memory usage of more than 900 mb for the script below). The culprit seem to be my use of use the matplotlib.dates.HourLocator on the x axis.
Here is a small script illustrating the problem:
---
import numpy as npy
import pylab, matplotlib
data = npy.ma.masked_values([0, 1], 0)
dates = npy.array([731186.91666667, 731187.04166667])
#This does not help either
#dates = npy.ma.array([731186.91666667, 731187.04166667], mask=data.mask)
pylab.plot(dates, data)
majloc = matplotlib.dates.HourLocator(interval=3)
ax = pylab.gca()
ax.xaxis.set_major_locator(majloc)
pylab.savefig('test.png')
---
System info:
Python 2.5.1 (r251:54863, Oct 5 2007, 13:36:32) 
[GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2
>>> print matplotlib.__version__
0.90.1
>>> print numpy.__version__
1.0.3
Regards,
Jesper
From: sa6113 <s.p...@gm...> - 2008年02月19日 09:32:27
I am writting an application that evaluate curve fit and draw its plot in a
GUI , I want to draw or show the plot on the GUI not on the pop up window,
but I don't want to save the figure in first step , user just enter an order
for the curve fit and see their plots on the main window (GUI) . 
How can I use pylab for this purpose , does it return and QImage object for
exm. ? 
sa6113 wrote:
> 
> How can I show my plot figure in the specific location or part of an
> application , I am using pylab.
> 
-- 
View this message in context: http://www.nabble.com/Showing-the-plot-in-the-specific-location-tp15545079p15560493.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
3 messages has been excluded from this view by a project administrator.

Showing results of 356

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