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 results of 347

<< < 1 .. 10 11 12 13 14 > >> (Page 12 of 14)
From: John H. <jdh...@ac...> - 2005年07月06日 22:03:18
>>>>> "Jeff" == Jeff Peery <jef...@se...> writes:
 Jeff> I'm using 'axes.clear()' to clear the canvas and then I call
 Jeff> plot_date. Is there a better way to clear the plots?
 Jeff> Thanks.
That is an alias for ax.cla, should work fine.
 Jeff> Also, I tried running your script and I get this error:
 Jeff> "Warning (from warnings module):
 Jeff> File "C:\Python24\lib\site-packages\matplotlib\__init__.py", line 604
 Jeff> warnings.warn('Could not find .matplotlibrc; using defaults')
 Jeff> UserWarning: Could not find .matplotlibrc; using defaults
For some reason matplotlib is not finding its config file and is
falling back on the gtk backend, which is failing on your system.
Grab a copy of the rc file at http://matplotlib.sf.net/.matplotlibrc
and drop it in C:\Python24\share\matplotlib, and edit the backend
setting to a backend appropriate for your system, eg TkAgg or WXAgg.
JDH
From: Jeff P. <jef...@se...> - 2005年07月06日 19:58:21
Also, I tried running your script and I get this error:
"Warning (from warnings module):
 File "C:\Python24\lib\site-packages\matplotlib\__init__.py", line 604
 warnings.warn('Could not find .matplotlibrc; using defaults')
UserWarning: Could not find .matplotlibrc; using defaults
Warning (from warnings module):
 File "C:\Python24\lib\site-packages\matplotlib\__init__.py", line 625
 warnings.warn(message)
UserWarning: could not find rc file; returning defaults
No module named pygtk
Traceback (most recent call last):
 File "C:/Documents and Settings/jeffp/Desktop/test.py", line 1, in
-toplevel-
 import pylab
 File "C:\Python24\lib\site-packages\pylab.py", line 1, in -toplevel-
 from matplotlib.pylab import *
 File "C:\Python24\lib\site-packages\matplotlib\pylab.py", line 196, in
-toplevel-
 import backends
 File "C:\Python24\lib\site-packages\matplotlib\backends\__init__.py",
line 19, in -toplevel-
 globals(),locals(),[backend_name])
 File
"C:\Python24\lib\site-packages\matplotlib\backends\backend_gtk.py", line
20, in -toplevel-
 from backend_gdk import RendererGDK
 File
"C:\Python24\lib\site-packages\matplotlib\backends\backend_gdk.py", line
28, in -toplevel-
 raise SystemExit('PyGTK version %d.%d.%d or greater is required to
run the GTK Matplotlib backends'
SystemExit: PyGTK version 1.99.16 or greater is required to run the GTK
Matplotlib backends"
Any idea what this means? Thanks.
Jeff
-----Original Message-----
From: John Hunter [mailto:jdh...@ni...] 
Sent: Wednesday, July 06, 2005 11:56 AM
To: Jeff Peery
Cc: mat...@li...
Subject: Re: [Matplotlib-users] plot date
>>>>> "Jeff" == Jeff Peery <jef...@se...> writes:
 Jeff> Hello, I'm using plot_date for some simple data. This
 Jeff> function seems to always use a symbol (marker). If I set
 Jeff> the line pattern to 'r-' I get a solid red line but also
 Jeff> blue markers. How can I use plot_date without symbols
 Jeff> showing up? Thanks.
Perhaps you are seeing a problem where your previous plot is not
cleared and so you see both on the same axes? The format strings
works for me as expected
 import pylab
 import datetime
 d1 = datetime.date( 1995, 1, 1 )
 d2 = datetime.date( 2004, 1, 1 )
 delta = datetime.timedelta(days=365)
 dates = pylab.drange(d1,d2,delta)
 y = pylab.rand(len(dates))
 pylab.plot_date(dates, y, 'r-')
 pylab.show()
JDH
From: Jeff P. <jef...@se...> - 2005年07月06日 19:53:52
I'm using 'axes.clear()' to clear the canvas and then I call plot_date.
Is there a better way to clear the plots? Thanks.
Jeff
-----Original Message-----
From: John Hunter [mailto:jdh...@ni...] 
Sent: Wednesday, July 06, 2005 11:56 AM
To: Jeff Peery
Cc: mat...@li...
Subject: Re: [Matplotlib-users] plot date
>>>>> "Jeff" == Jeff Peery <jef...@se...> writes:
 Jeff> Hello, I'm using plot_date for some simple data. This
 Jeff> function seems to always use a symbol (marker). If I set
 Jeff> the line pattern to 'r-' I get a solid red line but also
 Jeff> blue markers. How can I use plot_date without symbols
 Jeff> showing up? Thanks.
Perhaps you are seeing a problem where your previous plot is not
cleared and so you see both on the same axes? The format strings
works for me as expected
 import pylab
 import datetime
 d1 = datetime.date( 1995, 1, 1 )
 d2 = datetime.date( 2004, 1, 1 )
 delta = datetime.timedelta(days=365)
 dates = pylab.drange(d1,d2,delta)
 y = pylab.rand(len(dates))
 pylab.plot_date(dates, y, 'r-')
 pylab.show()
JDH
From: John H. <jdh...@ac...> - 2005年07月06日 18:56:14
>>>>> "Jeff" == Jeff Peery <jef...@se...> writes:
 Jeff> Hello, I'm using plot_date for some simple data. This
 Jeff> function seems to always use a symbol (marker). If I set
 Jeff> the line pattern to 'r-' I get a solid red line but also
 Jeff> blue markers. How can I use plot_date without symbols
 Jeff> showing up? Thanks.
Perhaps you are seeing a problem where your previous plot is not
cleared and so you see both on the same axes? The format strings
works for me as expected
 import pylab
 import datetime
 d1 = datetime.date( 1995, 1, 1 )
 d2 = datetime.date( 2004, 1, 1 )
 delta = datetime.timedelta(days=365)
 dates = pylab.drange(d1,d2,delta)
 y = pylab.rand(len(dates))
 pylab.plot_date(dates, y, 'r-')
 pylab.show()
JDH
From: Jeff P. <jef...@se...> - 2005年07月06日 18:47:22
Hello, I'm using plot_date for some simple data. This function seems to
always use a symbol (marker). If I set the line pattern to 'r-' I get a
solid red line but also blue markers. How can I use plot_date without
symbols showing up? Thanks.
Jeff
From: John H. <jdh...@ac...> - 2005年07月06日 17:18:12
>>>>> "Mark" == Mark Bakker <ma...@gm...> writes:
 Mark> John - The current option for 'axis('equal') only sets the
 Mark> coordinate range the same on each axis, correct? What I
 Mark> want is to have the lengths of the axes scaled according to
 Mark> the min/max values along the x and y axes. That is
 Mark> important when you contour spatial data, for example.
 Mark> That's the button I made.
axis('equal') should work like matlab's option. Your post suggests
that your version does and I infer therefore that the current
axis('equal') does not. I'm wondering if we should substitute your
version in there. Even if not, we can do both, with a suitably named
flag. Would you be willing to incorporate your suggestion into the
axis function and submit it as a patch to the sf site?
 Mark> I understand the hassle of adding a button that works on all
 Mark> back-ends. I'll try to post my button for the TK back-end
 Mark> and we'll take it from there.
Sounds good.
JDH
From: Mark B. <ma...@gm...> - 2005年07月06日 17:01:41
John -
The current option for 'axis('equal') only sets the coordinate range the=20
same on each axis, correct?
What I want is to have the lengths of the axes scaled according to the=20
min/max values along the x and y axes.
That is important when you contour spatial data, for example.=20
That's the button I made.
I understand the hassle of adding a button that works on all back-ends.
I'll try to post my button for the TK back-end and we'll take it from there=
.
Mark
On 7/6/05, John Hunter <jdh...@ac...> wrote:
>=20
> >>>>> "Mark" =3D=3D Mark Bakker <ma...@gm...> writes:
>=20
> Mark> Hello - I wrote a small function that scales the axes so
> Mark> that the true scale (e.g. the coordinates per inch) are the
> Mark> same along each axis. This is useful when you contour
> Mark> spatial data where the x and y axes are in meters, for
> Mark> example. It is equivalent to the 'axis equal' command in
> Mark> matlab. Except that once given that command in matlab it is
> Mark> persistent. Here you have to push the button every time you
> Mark> changed the figure window or zoom.
>=20
> Hey Mark,
>=20
> Did you know there is already an "equal" option to the axis command.
> If it doesn't work right, could you fix it and send me a patch?
>=20
> Mark> I added the function to the toolbar2 class and added a
> Mark> button to the toolbar. For the Tk backend this works great.
> Mark> And I don't think it is back-end dependent, but then again,
> Mark> what do I know.
>=20
> Mark> Any chance that such a button on the toolbar can be added to
> Mark> the official release? Or are there better ways to do this?
>=20
> This kind of button is useful to many but not others, and is a perfect
> candidate for a modular toolbar. We've talked in the past about
> supporting customized toolbars, with a contrib module for user defined
> tool functions. But this has stalled in part because modifying the
> toolbar across many GUIs is a pain. One solution would be to use
> matplotlib buttons in a GUI neutral toolbar -- then customizing it
> would be trivial and would work for free across backends.
>=20
> Perhaps you should post a patch or code so others could test your
> button and see if they like it enough to put it on the standard
> toolbar until we get support for custom, extensible toolbars.
>=20
> JDH
>
From: John H. <jdh...@ac...> - 2005年07月06日 14:51:13
>>>>> "Brice" == Brice Thurin <B.P...@ci...> writes:
 Brice> packages/matplotlib/font_manager.py", line 458, in
 Brice> createFontDict prop = ttfFontProperty(font) File
 Brice> "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-
 Brice> packages/matplotlib/font_manager.py", line 271, in
 Brice> ttfFontProperty sfnt = font.get_sfnt() RuntimeError: No
 Brice> SFNT name table
Try editing matplotlib/font_manager.py on line 458 and replacing
 prop = ttfFontProperty(font)
with 
 try: prop = ttfFontProperty(font)
 except: continue
Let me know if this helps...
JDH
From: John H. <jdh...@ac...> - 2005年07月06日 14:46:20
>>>>> "Yannick" == Yannick Copin <yc...@ip...> writes:
 Yannick> Hi, I have a strange error while importing pylab in
 Yannick> parallel to my own library. In the test script below, my
 Yannick> function open_spec (which has strictly nothing to do w/
 Yannick> pylab: it's a swig wrapper to a C-library of mine)
 Yannick> doesn't act the same if I import pylab first or not:
I assume if you comment out the pylab import the two print statements
are the same?
What version of matplotlib are you using?
If you are dereferencing a memory location you don't own in your
extension code, then anything that changes the memory layout could
lead to the effect you are seeing. What if you replace the 'import
pylab' with other imports, like 'import scipy' or 'import Tkinter'.
Do you see any effect?
matplotlib also includes some SWIG wrapped classes, these are imported
in matplotlib.lines which pylab imports. One way to test if this
might be the source of your troubles (different SWIG runtime
versions?) is to replace the 'import pylab' line with each of the
following in turn
 import matplotlib.agg
OR 
 import matplotlib.lines
OR 
 import matplotlib.patches
The first two import the SWIG code, the third does not. If the first
two cause the problem and the third does not, it looks like a SWIG
conflict.
JDH
From: Brice T. <B.P...@ci...> - 2005年07月06日 14:35:15
Hello,
I still have the same error, same with the binary package:
Traceback (most recent call last):
 File "<stdin>", line 1, in ?
 File 
"/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site- 
packages/pylab.py", line 1, in ?
 from matplotlib.pylab import *
 File 
"/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site- 
packages/matplotlib/pylab.py", line 198, in ?
 from axes import Axes, PolarAxes
 File 
"/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site- 
packages/matplotlib/axes.py", line 14, in ?
 from axis import XAxis, YAxis
 File 
"/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site- 
packages/matplotlib/axis.py", line 21, in ?
 from font_manager import FontProperties
 File 
"/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site- 
packages/matplotlib/font_manager.py", line 982, in ?
 fontManager = FontManager()
 File 
"/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site- 
packages/matplotlib/font_manager.py", line 826, in __init__
 rebuild()
 File 
"/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site- 
packages/matplotlib/font_manager.py", line 819, in rebuild
 self.ttfdict = createFontDict(self.ttffiles)
 File 
"/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site- 
packages/matplotlib/font_manager.py", line 458, in createFontDict
 prop = ttfFontProperty(font)
 File 
"/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site- 
packages/matplotlib/font_manager.py", line 271, in ttfFontProperty
 sfnt = font.get_sfnt()
RuntimeError: No SFNT name table
Many Thanks for your help
Brice
On 15 Jun 2005, at 18:58, Chris Barker wrote:
>
> Michael Twomey wrote:
>> I'd recommend trying Chris's binary package when he gets it done
>> (Chris, do you need any help on that front?).
>
> Well, not for what I intend to do, but I wasn't planning on building 
> in PyGTK support. In a way, doing that is contrary to my goal, which 
> is a package that can be installed on a stock OS-X (except Numerix, of 
> course). i.e. fink-free.
>
> However, it would probably work fine to have GTK compiled into the 
> binary, and it shouldn't break any of the other back-ends...it just 
> wouldn't work with PyGTK if PyGTK wasn't there, which is kind of 
> obvious.
>
> So, if someone want to build a package with PyGTK support, I'll send 
> you what I have to docs, and you can go to it. I'd love for there to 
> be only one "official" package, so if someone makes a superset of 
> mine, I won't distribute mine.
>
> -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...
>
>
> -------------------------------------------------------
> SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
> from IBM. Find simple to follow Roadmaps, straightforward articles,
> informative Webcasts and more! Get everything you need to get up to
> speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
From: John H. <jdh...@ac...> - 2005年07月06日 13:41:00
>>>>> "Mark" == Mark Bakker <ma...@gm...> writes:
 Mark> Hello - I wrote a small function that scales the axes so
 Mark> that the true scale (e.g. the coordinates per inch) are the
 Mark> same along each axis. This is useful when you contour
 Mark> spatial data where the x and y axes are in meters, for
 Mark> example. It is equivalent to the 'axis equal' command in
 Mark> matlab. Except that once given that command in matlab it is
 Mark> persistent. Here you have to push the button every time you
 Mark> changed the figure window or zoom.
Hey Mark,
Did you know there is already an "equal" option to the axis command.
If it doesn't work right, could you fix it and send me a patch?
 Mark> I added the function to the toolbar2 class and added a
 Mark> button to the toolbar. For the Tk backend this works great.
 Mark> And I don't think it is back-end dependent, but then again,
 Mark> what do I know.
 Mark> Any chance that such a button on the toolbar can be added to
 Mark> the official release? Or are there better ways to do this?
This kind of button is useful to many but not others, and is a perfect
candidate for a modular toolbar. We've talked in the past about
supporting customized toolbars, with a contrib module for user defined
tool functions. But this has stalled in part because modifying the
toolbar across many GUIs is a pain. One solution would be to use
matplotlib buttons in a GUI neutral toolbar -- then customizing it
would be trivial and would work for free across backends. 
Perhaps you should post a patch or code so others could test your
button and see if they like it enough to put it on the standard
toolbar until we get support for custom, extensible toolbars.
JDH
From: John H. <jdh...@ac...> - 2005年07月06日 13:33:23
>>>>> "Alex" == Alex Rada <ale...@ya...> writes:
 Alex> Hi, I'm using matplotlib v0.82 an I would like know if there
 Alex> is the possibility to set the markerfacecolor to
 Alex> "transparent", so that I can see two markers when they are
 Alex> one above the other.
With plot, which generates lines, in principle you should be able to
set the alpha channel. This controls the transparency of the edge and
the face (they aren't currently separable). However, in testing, I
just noticed that the transparency is not respected for markers with
the *Agg backends, which I think is a consequence of the way I
optimized marker drawing several releases back. I'll have to
investigate further. Also, transparency is not respected across
backends, eg PS, GTK, WX.
You can use transparent markers with scatter:
 from pylab import *
 x,y = rand(2,100)
 scatter(x, y, s=300, alpha=0.5)
 show()
It would be useful to have a markerfacecolor='None' option, which
worked across backends, even those which don't support transparency.
If you think this is sufficiently useful, please file a sourceforge
support request.
Cheers,
JDH
From: Darren D. <dd...@co...> - 2005年07月06日 12:54:02
On Wednesday 06 July 2005 8:47 am, Darren Dale wrote:
> y=load('bar.dat', delimiter=',')
I forgot to add that the option to specify a delimiter was introduced in 
matplotlib-0.81
Darren
From: Darren D. <dd...@co...> - 2005年07月06日 12:47:46
On Wednesday 06 July 2005 7:08 am, Vidar Gundersen wrote:
> does pylab.load('data.txt') support other
> ASCII data formats than the following?
>
> 4.6 3.1 1.5 0.2
> 4.6 3.4 1.4 0.3
> 5.4 3.7 1.5 0.2
> 5.8 4.0 1.2 0.2
> 5.4 3.9 1.3 0.4
>
> ...like:
>
> 4.6;3.1;1.5;0.2
> 4.6;3.4;1.4;0.3
> 5.4;3.7;1.5;0.2
> 5.8;4.0;1.2;0.2
> 5.4;3.9;1.3;0.4
x=load('foo.dat', delimiter=';')
> 4.6, 3.1, 1.5, 0.2
> 4.6, 3.4, 1.4, 0.3
> 5.4, 3.7, 1.5, 0.2
> 5.8, 4.0, 1.2, 0.2
> 5.4, 3.9, 1.3, 0.4
y=load('bar.dat', delimiter=',')
Darren
From: Ryan K. <rya...@co...> - 2005年07月06日 12:33:50
scipy.io.read_array will do this
read_array(fileobject, separator=None, columns=None, comment='#', 
lines=None, at
ype='d', linesep='\n', rowsize=10000, missing=0)
Vidar Gundersen wrote:
>does pylab.load('data.txt') support other
>ASCII data formats than the following?
>
> 4.6 3.1 1.5 0.2
> 4.6 3.4 1.4 0.3
> 5.4 3.7 1.5 0.2
> 5.8 4.0 1.2 0.2
> 5.4 3.9 1.3 0.4
>
>...like:
>
> 4.6;3.1;1.5;0.2
> 4.6;3.4;1.4;0.3
> 5.4;3.7;1.5;0.2
> 5.8;4.0;1.2;0.2
> 5.4;3.9;1.3;0.4
>
> 4.6, 3.1, 1.5, 0.2
> 4.6, 3.4, 1.4, 0.3
> 5.4, 3.7, 1.5, 0.2
> 5.8, 4.0, 1.2, 0.2
> 5.4, 3.9, 1.3, 0.4
>
>etc.
>
>R http://www.r-project.org/, has a nice solution for this:
>
>x <- read.table(file="data.txt", sep=";", dec=".", quote="\"")
>
>
>
>-------------------------------------------------------
>SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
>from IBM. Find simple to follow Roadmaps, straightforward articles,
>informative Webcasts and more! Get everything you need to get up to
>speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
>_______________________________________________
>Matplotlib-users mailing list
>Mat...@li...
>https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
> 
>
From: Vidar G. <vid...@37...> - 2005年07月06日 11:08:07
does pylab.load('data.txt') support other
ASCII data formats than the following?
 4.6 3.1 1.5 0.2
 4.6 3.4 1.4 0.3
 5.4 3.7 1.5 0.2
 5.8 4.0 1.2 0.2
 5.4 3.9 1.3 0.4
...like:
 4.6;3.1;1.5;0.2
 4.6;3.4;1.4;0.3
 5.4;3.7;1.5;0.2
 5.8;4.0;1.2;0.2
 5.4;3.9;1.3;0.4
 4.6, 3.1, 1.5, 0.2
 4.6, 3.4, 1.4, 0.3
 5.4, 3.7, 1.5, 0.2
 5.8, 4.0, 1.2, 0.2
 5.4, 3.9, 1.3, 0.4
etc.
R http://www.r-project.org/, has a nice solution for this:
x <- read.table(file="data.txt", sep=";", dec=".", quote="\"")
From: Alex R. <ale...@ya...> - 2005年07月06日 10:58:50
Hi,
I'm using matplotlib v0.82 an I would like know if there is the 
possibility to set the markerfacecolor to "transparent", so that I can 
see two markers when they are one above the other.
Thank you.
Alex.
From: Christian M. <mee...@un...> - 2005年07月06日 06:29:14
On 5 Jul 2005, at 17:00, John Hunter wrote:
>
> This is actually covered in the errorbar docstring, but subtly, so
> I'll elaborate here (and update the errorbar docs with this example)
Thank you John. Admittedly I overlooked that one.
Cheers,
Christian
From: John H. <jdh...@ac...> - 2005年07月05日 22:47:24
>>>>> "Bob" == Bob Ippolito <bo...@re...> writes:
 Bob> On Jun 17, 2005, at 4:09 PM, John Hunter wrote:
 >>>>>>> "Chris" == Chris Barker <Chr...@no...> writes:
 >>>>>>> 
 >>
 >>> Using data_files in this manner at all is usually the wrong
 >>> thing to do anyway. Python packages should really put the
 >>> files they need into the package, not some semi-random
 >>> location on the filesystem.
 >>> 
 >>
 Chris> I tend to trust Bob in these matters. What is the logic for
 Chris> putting all that stuff outside of the package directory?
 >> I was just following the lead of the distutils documentation
 >> circa 2003 which is when this section of setup.py written.
 >> Since distutils had a slot for data_files, I put my data files
 >> there, which seems reasonable even in hindsight. I'm not
 >> opposed to putting them somewhere else, especially if someone
 >> explains the why and how. I do try and preserve compatibility
 >> with older python versions, so 2.4 only solutions are not a
 >> good choice at the moment.
 Bob> Python 2.4 distutils has the functionality built-in,
 Bob> otherwise you can get it from setuptools (in the Python CVS
 Bob> sandbox, or from
 Bob> <http://peak.telecommunity.com/DevCenter/PythonEggs>). There
 Bob> have been various other hacks throughout the years to do it,
 Bob> but setuptools is the standard now.
 Bob> py2app uses setuptools when building itself, and it is
 Bob> certainly Python 2.3 compatible.
Hi Bob, 
Sorry for the delay getting back on this. I am starting to look at
setuptools and have read over (quickly)
http://peak.telecommunity.com/DevCenter/PythonEggs
A couple of questions:
 * Are you recommending using the full PythonEggs suite, or just the
 parts in the default setuptools that comes with python2.4 ? I
 notice for example, that pkg_resources is not available in Python
 2.4.1 setuptools. This is not a huge problem, since it is fairly
 easy to install/upgrade. Just wondering.
 * It is not clear to me what the "right" way is to
 distribute/install data files (eg fonts). You suggest above that
 the data_files directive is not the right way and that the data
 files should be placed in the package. I naively tried
 package_data with
 
 from setuptools import setup
 
 setup(name="matplotlib",
 ...snip...
 package_data = {
 'matplotlib.fonts' : glob.glob('fonts/afm/*.afm'),
 },
 package_dir = {'': 'lib'},
 )
 where fonts/afm in the relative path has a bunch of *.afm fonts,
 but no files were added to site-packages/matplotlib/fonts/ when I
 did a 'sudo python setup.py install'. I read over the py2app
 setup at http://svn.red-bean.com/bob/py2app/trunk/setup.py but
 still was unsure how to proceed. The PythonEgg resource
 documentation spends a fair amount of space on how to "access"
 resources, but I missed how to specify them for the distribution
 (http://peak.telecommunity.com/DevCenter/PythonEggs#accessing-package-resources)
 So that is a long-winded way of asking "how should data files be
 placed in the package for distribution?"
 
Thanks,
JDH
From: John H. <jdh...@ac...> - 2005年07月05日 19:12:55
>>>>> "Torsten" =3D=3D Torsten Bronger <br...@ph...> wr=
ites:
 Torsten> Hall=F6chen! John Hunter <jdh...@ac...>
 Torsten> writes:
 >>>>>>> "Torsten" =3D=3D Torsten Bronger
 >>>>>>> <br...@ph...> writes:
 >>
 Torsten> 2. The above loop is the last part of my program. The
 Torsten> program terminates with
 >>
 Torsten> Fatal Python error: PyEval_RestoreThread: NULL tstate
 >>
 Torsten> Apparently, this is done by my improper handling of
 Torsten> matplotlib. What's going wrong?
 >> This is an annoyance we haven't been able to get rid of in all
 >> use cases. animation using pylab and tkagg is one of the
 >> places. I assume you are using the tkagg backend?
 Torsten> Yes.
 >> If you search the mailing list archives for
 >> PyEval_RestoreThread, you'll see this in many contexts. For
 >> any semi-serious animation work, I suggest you not use the
 >> matplotlib/interactive mode shown in anim.py but rather use
 >> your GUI's idle handling or timer mechanism as in
 >> examples/anim_tk.py or examples/dyamic_image_gtkagg.py.
 Torsten> Thanks, I'll do.
 >> [...]
 >>=20
 Torsten> 3. How can I achieve that dynamic autoscaling of the
 Torsten> y-axis? As noted in the source, "gcf().autoscale_view"
 Torsten> has no effect.
 >> This is not legal matplotlib code -- I assume you mean
 >> gca().autoscale_view().
 Torsten> Yes, sorry.
 >> In the absence of more information it is hard top diagnose what
 >> the problem is.
 Torsten> Here is a complete example:
OK, that helps. The update of the data limits happens when you call
plot and friends (technically plot calls ax.add_line which calls
ax.update_datalim_numerix) . If you manually set the xdata or ydata
on the line object, you need to manually update the Axes datalim with
ax =3D gca()
for i in range(2*cycles):
 voltages =3D number_of_values * [i % 2 + 3]
 y_values[i * number_of_values : (i+1) * number_of_values] =3D \
 voltages
 line.set_ydata(y_values)
 ax.update_datalim_numerix(x_values, y_values)
 ax.autoscale_view()
 draw()
 time.sleep(1)
JDH
From: Patrick O. <Sky...@co...> - 2005年07月05日 19:01:58
Hi,
I am putting together a system model that uses wxpython sliders and
buttons for controls. I would like to use notebook tabs/windows for
different sections and have one notebook window for plotting. I have
hunted through the matplotlib examples but have not found any that use
something other than a wxFrame. I apologize for not digging deep to
solve the problem, but if someone had an example or an explanation of
what is necessary, I would greatly appreciate it.
Thanks,
Pat ODonnell
From: Steve C. <ste...@ya...> - 2005年07月05日 18:57:28
On Sat, 2005年07月02日 at 09:59 -0500, John Hunter wrote:
[...]
> Also, we have to balance inconvenience of package developers with
> inconvenience of users. Given a choice, I tend to inconvenience the
> power users, because they are more able and willing to deal with it.
Its not just a tradeoff between package developers and users because
if you make things easy for package developers you also make things
easier for users (who use those packages) since they are now able
to install from the package instead of using cvs or a tar or zip file.
> That said, I think there is a compromise solution which may satisfy
> everyone. Following Chris Barker's suggestion, we can create a zip
> file or tarball of matplotlib deps, which has the src of all of the
> prereqs (except python and numerix) in it, and rewrite the setup to
> have a proper configure, checking for each prereq and issuing a kind
> error like "you are missing the freetype prereq, please install it or
> download http://someserver.com/mpldeps.zip and unzip it in this dir.
> This would keep the matplotlib distro (and CVS updates) as light as
> possible while making it easier to compile mpl on OSX and some linux
> distros. Of course, to do this right requires a fair amount of
> effort, but I am all for it. I worked for a while trying to use the
> distutils configure functionality (which can test for include headers,
> libs and the like) but was unsuccessful. The question that stumped me
> was how to properly communicate the results of the config process to
> the build process. I posted this to c.l.python but got no answer:
> http://groups-beta.google.com/group/comp.lang.python/browse_thread/thread/97cbe06f5efa58c0/18a015cba8bf2bd0?q=author:jdh...@ac...+group:comp.lang.python+distutils&rnum=1&hl=en#18a015cba8bf2bd0
A light cvs with a zipfile of dependencies seems like a good idea.
Maybe there was no response to the distutils question because nobody
knows how to do it, or because distutils is not powerful enough to
support it very well. Or just because nobody else writes Python packages
with as many dependencies as matplotlib!
The Python source code (and PyGTK) use gnu autotools (autoconf,
automake, etc) to configure and install themselves. Its more powerful
than distutils and is used by many C projects, but can be used for
Python too.
Steve
Send instant messages to your online friends http://au.messenger.yahoo.com 
From: Fernando P. <Fer...@co...> - 2005年07月05日 18:31:22
Steve Chaplin wrote:
> On Fri, 2005年07月01日 at 20:28 -0700,
> mat...@li... wrote:
> 
>>Eric Emsellem wrote:
>>
>>>Hi,
>>>a short report on 2 minor problems I face with matplotlib:
>>>
>>>- I tried to save a figure in gif. It gave me back an error message 
>>>saying that basically this is not supported. This is fine of course. 
>>>However, then the plot window crashed, and then the whole Ipython 
>>>session. It would be useful then to have this error not affecting the 
>>>session in this way if possible.
>>
>>I can see the problem in the GTK backend, but all other backends I tried under 
>>linux (TkAgg, QtAgg and WXAgg) all behave correctly. This seems like a bug in 
>>the GTK backend to me: it puts out to the screen an error message box, but the 
>>OK button in that box is unresponsive. Eventually the window manager just 
>>kills the window, which brings the whole python process down with it.
>>
>>I don't know the backends enough to know what the right solution should be here.
> 
> 
> I think this is an example where the IPython method of using threads to
> interactively execute gtk commands does not work.
> A minimal example that gives the same problem:
> 
> $ ipython -gthread
> In [1]: import gtk
> In [2]: md=gtk.MessageDialog(buttons=gtk.BUTTONS_CLOSE,
> message_format="message")
> In [3]: md.run()
> 
> gtk_dialog_run() blocks in a recursive main loop until the dialog either
> emits the response signal, or is destroyed.
> This gives the effect of a modal dialog. It works fine from within a GTK
> program, but gives problems when used through IPython.
Mmh, I just don't know enough about GTK to consider what the right approach 
should be. Is this something that ipython should handle differently? I'll 
gladly incorporate any fixes, if I knew what they need to be :)
Cheers,
f
From: Steve C. <ste...@ya...> - 2005年07月05日 18:24:30
On Fri, 2005年07月01日 at 20:28 -0700,
mat...@li... wrote:
> Eric Emsellem wrote:
> > Hi,
> > a short report on 2 minor problems I face with matplotlib:
> > 
> > - I tried to save a figure in gif. It gave me back an error message 
> > saying that basically this is not supported. This is fine of course. 
> > However, then the plot window crashed, and then the whole Ipython 
> > session. It would be useful then to have this error not affecting the 
> > session in this way if possible.
> 
> I can see the problem in the GTK backend, but all other backends I tried under 
> linux (TkAgg, QtAgg and WXAgg) all behave correctly. This seems like a bug in 
> the GTK backend to me: it puts out to the screen an error message box, but the 
> OK button in that box is unresponsive. Eventually the window manager just 
> kills the window, which brings the whole python process down with it.
> 
> I don't know the backends enough to know what the right solution should be here.
I think this is an example where the IPython method of using threads to
interactively execute gtk commands does not work.
A minimal example that gives the same problem:
$ ipython -gthread
In [1]: import gtk
In [2]: md=gtk.MessageDialog(buttons=gtk.BUTTONS_CLOSE,
message_format="message")
In [3]: md.run()
gtk_dialog_run() blocks in a recursive main loop until the dialog either
emits the response signal, or is destroyed.
This gives the effect of a modal dialog. It works fine from within a GTK
program, but gives problems when used through IPython.
Regards
Steve
Send instant messages to your online friends http://au.messenger.yahoo.com 
From: Torsten B. <br...@ph...> - 2005年07月05日 17:44:02
Hallöchen!
John Hunter <jdh...@ac...> writes:
>>>>>> "Torsten" == Torsten Bronger <br...@ph...> writes:
>
> Torsten> 2. The above loop is the last part of my program. The
> Torsten> program terminates with
>
> Torsten> Fatal Python error: PyEval_RestoreThread: NULL
> Torsten> tstate
>
> Torsten> Apparently, this is done by my improper handling of
> Torsten> matplotlib. What's going wrong?
>
> This is an annoyance we haven't been able to get rid of in all use
> cases. animation using pylab and tkagg is one of the places. I
> assume you are using the tkagg backend?
Yes.
> If you search the mailing list archives for PyEval_RestoreThread,
> you'll see this in many contexts. For any semi-serious animation
> work, I suggest you not use the matplotlib/interactive mode shown
> in anim.py but rather use your GUI's idle handling or timer
> mechanism as in examples/anim_tk.py or
> examples/dyamic_image_gtkagg.py.
Thanks, I'll do.
> [...]
>
> Torsten> 3. How can I achieve that dynamic autoscaling of the
> Torsten> y-axis? As noted in the source, "gcf().autoscale_view"
> Torsten> has no effect.
>
> This is not legal matplotlib code -- I assume you mean
> gca().autoscale_view().
Yes, sorry.
> In the absence of more information it is hard top diagnose what
> the problem is.
Here is a complete example:
#----------------------------------------------------------
from pylab import *
import time
ion()
cycles = 10
number_of_values = 100
total_number_values = 2 * cycles * number_of_values
x_values = arange(0, 2 * cycles, 1.0 / number_of_values)
y_values = total_number_values * [0.0]
line, = plot(x_values, y_values)
for i in range(2*cycles):
 voltages = number_of_values * [i % 2 + 3]
 y_values[i * number_of_values : (i+1) * number_of_values] = \
 voltages
 line.set_ydata(y_values)
 gca().autoscale_view()
 draw()
 time.sleep(1)
#----------------------------------------------------------
Here, no autoscaling happens.
Tschö,
Torsten.
-- 
Torsten Bronger, aquisgrana, europa vetus
1 message has been excluded from this view by a project administrator.

Showing results of 347

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