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
(3) |
|
2
|
3
(1) |
4
(7) |
5
(7) |
6
(11) |
7
(3) |
8
(4) |
|
9
(5) |
10
(5) |
11
(15) |
12
(7) |
13
(5) |
14
(4) |
15
(5) |
|
16
|
17
(4) |
18
(8) |
19
(12) |
20
(11) |
21
(4) |
22
(2) |
|
23
(4) |
24
(7) |
25
(5) |
26
(13) |
27
(3) |
28
(10) |
29
(3) |
|
30
(1) |
31
(15) |
|
|
|
|
|
|
From: Dominique O. <Dom...@po...> - 2005-01-31 23:31:49
|
John Hunter wrote: >>>>>>"Dominique" == Dominique Orban <Dom...@po...> writes: > > Dominique> Regarding the use of transforms in Matplotlib, what > Dominique> would be the simplest way to convert a quantity > Dominique> expressed in data coordinates to points and conversely? > > # display coords > dx, dy = trans.xy_tup(x, y) > > # points from left of figure window > px = dx/dpi*72 > > # points from bottom of figure window > py = dy/dpi*72 Thanks, I think I understand. The reason I ask is to be able to compute displacements in data coordinates when they are given in points. Now I am confused by the following test (Windows XP, Matplotlib 0.71, Numeric 23.0 from the Enthought edition of Python 2.3): ################## from matplotlib.pylab import * from matplotlib import rcParams dpi = rcParams['figure.dpi'] ppi = 72.0 ratio = ppi/dpi ax = axes( [0.1, 0.1, 0.8, 0.8] ) trans = ax.transData z = (0,0) dz = trans.xy_tup( z ) ddz = ( dz[0]*ratio, dz[1]*ratio ) print str(z) + ' in data units is ' + str(ddz) + ' in screen coords' # See how many data units in each direction is a # displacement of 'delta' points in each direction delta = 5 r = ( ddz[0] + delta, ddz[1] + delta) # = origin + (10, 10) rdx, rdy = trans.inverse_xy_tup( r ) rddx = rdx/ratio rddy = rdy/ratio print str(r) + ' in screen coords is ' + str((rddx,rddy)) + ' in data units' ################## This script produces: (0, 0) in data units is (57.600000000000001, 43.200000000000003) in screen coords (62.600000000000001, 48.200000000000003) in screen coords is (-0.0030381944444444415, 0.00057870370370370161) in data units How is it possible that I obtain a negative number in this last tuple? Is it a numerical error or am I missing something? A second question: I want to draw a line going from (0,0) to (1,1), but that stops short of (1,1), leaving just enough room for an object that has a radius of 5 points. Is this how I should compute how far from (1,1) the line should stop, in data coordinates? Yes, this is related to the arrow class I mentioned in an earlier post. This is an attempt to adjust the position of the arrow head, so its tip points to, e.g., (1,1) and the stem is just long enough that it doesn't overlap with the head. I'm probably not choosing the easy way but then, I am not sure what the easy way would be. Many thanks, Dominique |
|
From: John H. <jdh...@ac...> - 2005-01-31 23:20:09
|
>>>>> "seberino" == seberino <seb...@sp...> writes:
seberino> I have great working matplotlib pylab code that fires
seberino> off a new plot when asked to.
seberino> Now we want to embed/add this code into an existing wx
seberino> gui....Is it possible to make the pylab code embed the
seberino> plot into an existing gui window rather than creating a
seberino> //new// plot window/widget?
seberino> Also, a colleague says wx doesn't seem to play nice with
seberino> pylab module. Is pylab somehow slower or not the best
seberino> fit with wx?? He says 'Figure()' code seems better with
seberino> wx. Any advice/comments greatly appreciated.
Your colleague is right. The main problem with mixing the pylab
interface with your own wx widgets is that pylab controls the windows
it creates, eg managing destroy etc.
For examples on how to embed matplotlib is an wx application, see the
examples/embedding_in_wx*.py demos in the matplotlib src distro.
Hope this helps!
JDH
|
|
From: John H. <jdh...@ac...> - 2005-01-31 22:41:06
|
>>>>> "Tom" == Tom Loredo <lo...@as...> writes:
Tom> /usr/include/pygtk-2.0/pygobject.h:140: error: expected `,'
Tom> or `...' before "typename"
Tom> /usr/include/pygtk-2.0/pygobject.h:147: error: expected `,'
Tom> or `...' before "typename" error: command 'gcc' failed with
Tom> exit status 1
Hey Tom,
This looks a lot like the FAQ
http://matplotlib.sourceforge.net/faq.html#PYGTK24
Hope this helps...
JDH
|
|
From: Matthew B. <mat...@gm...> - 2005-01-31 22:27:08
|
Hi, I ran into this recently. My own approach was merely to apply this change: http://cvs.gnome.org/viewcvs/gnome-python/pygtk/ChangeLog?rev=1.1053 "gobject/pygobject.h: s/typename/typename_/, because typename is a C++ keyword." Best, Matthew > I had some trouble installing matplotlib on a machine running > Fedora Core 3 and Python 2.3.4. I eventually got it to work, > and thought I'd pass on my experiences in case (1) they might > be helpful to other FC3 users, and (2) I may have overlooked > something that an FC3 expert can point out. > > I should note that I have two Pythons on this machine; Fedora's > is in /usr/bin, and I keep the one I use myself in /usr/local/bin, > so I can update it without fear of interfering with Fedora's > Python (standard Redhat/Fedora procedure, I believe). > > Here's the symptom: "python setup.py build" always quits > as follows: > > ~~~~~~~~~~~~~~~~~~~~~~~~~ > gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include -I/usr/include > -Isrc -Iagg22/include -I. -I/usr/local/include -I/usr/include -I/usr/local/include/freetype2 -I/usr/include/freetype2 > -Isrc/freetype2 -Iagg22/include/freetype2 -I./freetype2 -I/usr/local/include/freetype2 -I/usr/include/freetype2 > -I/usr/local/include -I/usr/include -I/usr/include/pygtk-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include > -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/X11R6/include -I/usr/include/atk-1.0 -I/usr/include/pango-1.0 > -I/usr/include/freetype2 -I/usr/include/freetype2/config -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include > -I/usr/local/include/python2.3 -c src/_gtkagg.cpp -o build/temp.linux-i686-2.3/src/_gtkagg.o > cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++ > In file included from /usr/local/include/python2.3/Python.h:8, > from /usr/include/pygtk-2.0/pygobject.h:5, > from src/_gtkagg.cpp:8: > /usr/local/include/python2.3/pyconfig.h:850:1: warning: "_POSIX_C_SOURCE" redefined > In file included from /usr/include/string.h:26, > from /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/cstring:51, > from src/_gtkagg.cpp:1: > /usr/include/features.h:150:1: warning: this is the location of the previous definition > In file included from src/_gtkagg.cpp:8: > /usr/include/pygtk-2.0/pygobject.h:140: error: expected `,' or `...' before "typename" > /usr/include/pygtk-2.0/pygobject.h:147: error: expected `,' or `...' before "typename" > error: command 'gcc' failed with exit status 1 > > ~~~~~~~~~~~~~~~~~~~~~~ > > This looks like a problem with the pytgtk installation. So I tried installing > pygtk from source. > > First I tried the latest/greatest version, 2.5.3, just posted on the pygtk site. > It requires a newer version of the GTK+ libraries than is included in FC3. > I tried installing these (first GLib, then Pango, ATK and GTK+) but > couldn't get past GLib. By default these install in /usr/local. FC3 comes > with them in /usr. What little I could find online indicates that it is > a BAD THING to have a newer version sitting in /usr/local, and that the > best procedure is to stick with the current version or install any updates > from RPMs. (It was not recommended that one overwrite the FC3 installation > via ./configure --prefix=/usr.) I could not find FC3 RPMs for the latest GTK+, > so I gave up on that, and deleted all the GTK stuff I had installed in /usr/local. > > Next I tried the previous stable version of pygtk, 2.4.1. The install > went fine, but a subsequent attempt at installing matplotlib duplicated > the problem noted above. However, pygtk installs into /usr/local by > default, and FC3 comes with it in /usr, and matplotlib was having a problem > with the /usr version. (Sure enough, a "diff" shows the newer version > I had in /usr/local has pygobject.h modified.) So I *reinstalled* 2.4.1 > into /usr using > > # ./configure --prefix=/usr > > Now matplotlib builds fine. I have copies of pygtk in both /usr and > /usr/local; I'm not sure if that will cause me problems. As root, > my shell runs /usr/local/bin/python; I suspect /usr/bin/python may > have an incompatible pygtk site-package at this point, but I haven't > pursued this since I don't use the FC3 python version myself. > > If FC3 experts out there can identify a problem with this procedure, > please let me know! > > Thanks, > Tom Loredo > > ------------------------------------------------- > This mail sent through IMP: http://horde.org/imp/ > > ------------------------------------------------------- > This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting > Tool for open source databases. Create drag-&-drop reports. Save time > by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. > Download a FREE copy at http://www.intelliview.com/go/osdn_nl > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
|
From: Tom L. <lo...@as...> - 2005-01-31 22:07:23
|
Hi folks-
I had some trouble installing matplotlib on a machine running
Fedora Core 3 and Python 2.3.4. I eventually got it to work,
and thought I'd pass on my experiences in case (1) they might
be helpful to other FC3 users, and (2) I may have overlooked
something that an FC3 expert can point out.
I should note that I have two Pythons on this machine; Fedora's
is in /usr/bin, and I keep the one I use myself in /usr/local/bin,
so I can update it without fear of interfering with Fedora's
Python (standard Redhat/Fedora procedure, I believe).
Here's the symptom: "python setup.py build" always quits
as follows:
~~~~~~~~~~~~~~~~~~~~~~~~~
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include -I/usr/include
-Isrc -Iagg22/include -I. -I/usr/local/include -I/usr/include -I/usr/local/include/freetype2 -I/usr/include/freetype2
-Isrc/freetype2 -Iagg22/include/freetype2 -I./freetype2 -I/usr/local/include/freetype2 -I/usr/include/freetype2
-I/usr/local/include -I/usr/include -I/usr/include/pygtk-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include
-I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/X11R6/include -I/usr/include/atk-1.0 -I/usr/include/pango-1.0
-I/usr/include/freetype2 -I/usr/include/freetype2/config -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include
-I/usr/local/include/python2.3 -c src/_gtkagg.cpp -o build/temp.linux-i686-2.3/src/_gtkagg.o
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
In file included from /usr/local/include/python2.3/Python.h:8,
from /usr/include/pygtk-2.0/pygobject.h:5,
from src/_gtkagg.cpp:8:
/usr/local/include/python2.3/pyconfig.h:850:1: warning: "_POSIX_C_SOURCE" redefined
In file included from /usr/include/string.h:26,
from /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/cstring:51,
from src/_gtkagg.cpp:1:
/usr/include/features.h:150:1: warning: this is the location of the previous definition
In file included from src/_gtkagg.cpp:8:
/usr/include/pygtk-2.0/pygobject.h:140: error: expected `,' or `...' before "typename"
/usr/include/pygtk-2.0/pygobject.h:147: error: expected `,' or `...' before "typename"
error: command 'gcc' failed with exit status 1
~~~~~~~~~~~~~~~~~~~~~~
This looks like a problem with the pytgtk installation. So I tried installing
pygtk from source.
First I tried the latest/greatest version, 2.5.3, just posted on the pygtk site.
It requires a newer version of the GTK+ libraries than is included in FC3.
I tried installing these (first GLib, then Pango, ATK and GTK+) but
couldn't get past GLib. By default these install in /usr/local. FC3 comes
with them in /usr. What little I could find online indicates that it is
a BAD THING to have a newer version sitting in /usr/local, and that the
best procedure is to stick with the current version or install any updates
from RPMs. (It was not recommended that one overwrite the FC3 installation
via ./configure --prefix=/usr.) I could not find FC3 RPMs for the latest GTK+,
so I gave up on that, and deleted all the GTK stuff I had installed in /usr/local.
Next I tried the previous stable version of pygtk, 2.4.1. The install
went fine, but a subsequent attempt at installing matplotlib duplicated
the problem noted above. However, pygtk installs into /usr/local by
default, and FC3 comes with it in /usr, and matplotlib was having a problem
with the /usr version. (Sure enough, a "diff" shows the newer version
I had in /usr/local has pygobject.h modified.) So I *reinstalled* 2.4.1
into /usr using
# ./configure --prefix=/usr
Now matplotlib builds fine. I have copies of pygtk in both /usr and
/usr/local; I'm not sure if that will cause me problems. As root,
my shell runs /usr/local/bin/python; I suspect /usr/bin/python may
have an incompatible pygtk site-package at this point, but I haven't
pursued this since I don't use the FC3 python version myself.
If FC3 experts out there can identify a problem with this procedure,
please let me know!
Thanks,
Tom Loredo
-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/
|
|
From: Stephen W. <ste...@cs...> - 2005-01-31 20:01:54
|
John Hunter wrote: >So the doc line with the tuple unpacking is *incorrect*, because tuple >unpacking will fail w/o the transpose. > Ouch. I completely missed the fact that Nicolas was commenting on the docstring, and generated a fair amount of noise as a result. Thanks, John. |
|
From: John H. <jdh...@ac...> - 2005-01-31 20:01:53
|
>>>>> "Dominique" == Dominique Orban <Dom...@po...> writes:
Dominique> Regarding the use of transforms in Matplotlib, what
Dominique> would be the simplest way to convert a quantity
Dominique> expressed in data coordinates to points and conversely?
Dominique> Are the methods gca().transData.xy_tup() and
Dominique> inverse_xy_tup() what I'm looking for? If so, how
Dominique> should I be calling them?
I think the easiest way is to transform the data to screen coordinates
and then apply a scale factor to convert pixels to points. All of the
transform methods
xy_tup(xy) - transform the tuple (x,y)
seq_x_y(x, y) - transform the python sequences x and y
numerix_x_y(x, y) - x and y are numerix 1D arrays
seq_xy_tups(seq) - seq is a sequence of xy tuples
return screen coords. To get points from left, bottom, you would
could convert to inches by dividing by dpi, and then multiply by the
number of points per inch. Untested, off the cuff, but should be
right:
# display coords
dx, dy = trans.xy_tup(x, y)
# points from left of figure window
px = dx/dpi*72
# points from bottom of figure window
py = dy/dpi*72
with the usual caveat that screen dpi is not the same in the x and y
directions so the physical units may not be exact when displayed.
JDH
|
|
From: Humufr <hu...@ya...> - 2005-01-31 19:59:27
|
Yes thank you John. It's perfect. Sorry for this but I pass so many
times to understand the problem that I was thinking that another
beginner will have the same problem than me.
Nicolas
John Hunter wrote:
>>>>>>"Stephen" == Stephen Walton <ste...@cs...> writes:
>>>>>>
>>>>>>
>
> Stephen> Humufr wrote:
> >> I agree with you but in the load function documentation I can
> >> read this:
> >>
> >> x,y = load('test.dat') # data in two columns
>
> Stephen> The documentation for load is correct. Consider
>
> Stephen> A=load('test.dat')
>
> Stephen> If 'test.dat' has 17 rows and 2 columns, A.shape will be
> Stephen> (17,2), "print A" will print an array with 17 rows and 2
> Stephen> columns, and so on. But
>
> Stephen> x,y=A
>
> Stephen> will not work, because tuple unpacking of numarray arrays
> Stephen> goes by rows, not by columns.
>
>So the doc line with the tuple unpacking is *incorrect*, because tuple
>unpacking will fail w/o the transpose. I modified the docs to read
>
> Example usage:
>
> X = load('test.dat') # data in two columns
> t = X[:,0]
> y = X[:,1]
>
> Alternatively, you can do
>
> t,y = transpose(load('test.dat')) # for two column data
>
>Everybody happy with that?
>
>JDH
>
>
|
|
From: Chris B. <Chr...@no...> - 2005-01-31 19:56:40
|
Python is not MATLAB!
Humufr wrote:
> I agree with you but in the load function documentation I can read this:
> and not a file like:
>
> 1 1 1 1 1
> 2 2 2 2 2
>
> it's why I suggest to add the transpose in the load function.
However, Matlab does exactly this, for the same reason. I always thought
that was stupid, but a goal of pylab is to be matlab compatible, so it
should probably not be transposed automatically.
> For the comments for the beggining of an array indexing I know it :) but
> I hate it (it's just a tast :) )
You may come to love it. I know I do. While indexing from 1 seems most
natural at first, it results in ugly arithmetic when slicing. I came
from Matlab, and python's indexing seemed ugly at first, but then I
found that so many thing work much more naturally:
len(a[i:j]) = j-i
len(s[-3:]) = 3
l[i:j] + l[j:k] = l[i:k]
You'd be adding and subtracting a lot of ones if python had one-based
indexing.
Also, if you have a grid, spaced out by DeltaX:
The X -coord of a[i] is:
X0 + i*DeltaX
With one based indexing, it would be:
X0 + (i-1) * DeltaX
But most of all, Python indexes from 0, whether you like it or not, so
it's probably best to stick with that in Python functions.
-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-01-31 19:46:26
|
>>>>> "Stephen" == Stephen Walton <ste...@cs...> writes:
Stephen> Humufr wrote:
>> I agree with you but in the load function documentation I can
>> read this:
>>
>> x,y = load('test.dat') # data in two columns
Stephen> The documentation for load is correct. Consider
Stephen> A=load('test.dat')
Stephen> If 'test.dat' has 17 rows and 2 columns, A.shape will be
Stephen> (17,2), "print A" will print an array with 17 rows and 2
Stephen> columns, and so on. But
Stephen> x,y=A
Stephen> will not work, because tuple unpacking of numarray arrays
Stephen> goes by rows, not by columns.
So the doc line with the tuple unpacking is *incorrect*, because tuple
unpacking will fail w/o the transpose. I modified the docs to read
Example usage:
X = load('test.dat') # data in two columns
t = X[:,0]
y = X[:,1]
Alternatively, you can do
t,y = transpose(load('test.dat')) # for two column data
Everybody happy with that?
JDH
|
|
From: Stephen W. <ste...@cs...> - 2005-01-31 19:38:15
|
Humufr wrote:
> I agree with you but in the load function documentation I can read this:
>
> x,y = load('test.dat') # data in two columns
The documentation for load is correct. Consider
A=load('test.dat')
If 'test.dat' has 17 rows and 2 columns, A.shape will be (17,2), "print
A" will print an array with 17 rows and 2 columns, and so on. But
x,y=A
will not work, because tuple unpacking of numarray arrays goes by rows,
not by columns.
|
|
From: Humufr <hu...@ya...> - 2005-01-31 19:00:20
|
I agree with you but in the load function documentation I can read this:
x,y = load('test.dat') # data in two columns
so if I interpret this correctly that means a data file like:
1 2
1 2
1 2
1 2
1 2
and not a file like:
1 1 1 1 1
2 2 2 2 2
it's why I suggest to add the transpose in the load function.
For the second things (the columns). Your example show that you can read
two columns consecutive but if you want read the columns 3,5,7,8 that
can't work. Like it's only an optionnal argument I was thinking that was
possible to add this possibilty in the load function inside pylab.
For the comments for the beggining of an array indexing I know it :) but
I hate it (it's just a tast :) ) and I prefer to name/count the column
in a data file from 1 so instead to tell to someone: "Use the zero
columns" I prefer to tell "Use the first columns". It's only a matter of
choice. But it's why I add: array(columns)-1.
Nicolas
Stephen Walton wrote:
> I don't think the load function needs to be changed in the way you
> suggest. The "problem" is not the load function. It is the fact that
> numarray arrays are stored in row-major, not column-major, order, and
> so tuple unpacking a numarray array goes by row, not by column.
>
> In [15]: A=arange(6)
>
> In [16]: A.shape=(3,2)
>
> In [17]: x,y=A
> ---------------------------------------------------------------------------
>
> exceptions.ValueError Traceback (most
> recent call last)
>
> ValueError: too many values to unpack
>
> The transpose is required here as well if you want to unpack by
> columns. If I have a file containing 731 rows and 17 columns and use
> 'load', I get an array with 731 rows and 17 columns, exactly as I expect.
>
> I'm far from a Python expert myself ;-) , but you can do what you're
> trying with the single line
>
> x,y=transpose(load('toto.dat')[:,1:3])
>
> (note that array indexing in Python is zero-based, not one-based, and
> also read up on how slices work).
>
>
|
|
From: Stephen W. <ste...@cs...> - 2005-01-31 18:40:23
|
I don't think the load function needs to be changed in the way you
suggest. The "problem" is not the load function. It is the fact that
numarray arrays are stored in row-major, not column-major, order, and so
tuple unpacking a numarray array goes by row, not by column.
In [15]: A=arange(6)
In [16]: A.shape=(3,2)
In [17]: x,y=A
---------------------------------------------------------------------------
exceptions.ValueError Traceback (most
recent call last)
ValueError: too many values to unpack
The transpose is required here as well if you want to unpack by
columns. If I have a file containing 731 rows and 17 columns and use
'load', I get an array with 731 rows and 17 columns, exactly as I expect.
I'm far from a Python expert myself ;-), but you can do what you're
trying with the single line
x,y=transpose(load('toto.dat')[:,1:3])
(note that array indexing in Python is zero-based, not one-based, and
also read up on how slices work).
|
|
From: Dominique O. <Dom...@po...> - 2005-01-31 18:33:31
|
Regarding the use of transforms in Matplotlib, what would be the simplest way to convert a quantity expressed in data coordinates to points and conversely? Are the methods gca().transData.xy_tup() and inverse_xy_tup() what I'm looking for? If so, how should I be calling them? Thanks Dominique |
|
From: Humufr <hu...@ya...> - 2005-01-31 16:01:58
|
Hi John,
I did some change in the load function, it's help for me so perhaps some
other people will appreciate it. I add the possibility to choose which
columns inside a file you want use.
ex: I have a file like:
1 2 3
1 2 3
1 2 3
and I want use only the columns 2 and 3:
so I can do this with the new load function:
load('toto.dat',columns=[2,3])
Perhaps you can arrange this to have something a little bit cleaner (I'm
a beginner with python).
I add the change to have the matrix transpose too to correct the problem
I hab before to recuperate the columns and not the lines when you are doing:
x,y,z = load('toto.dat')
Thanks,
Nicolas
ps: I add something inside the doc but you had to correct this too for a
correct english or/and more understandable text if you include these
changes.
------------------------------------------------------------
def load(fname,comments='%',columns=None):
"""
Load ASCII data from fname into an array and return the array.
The data must be regular, same number of values in every row
fname can be a filename or a file handle.
A character for to delimit the comments can be use (optional),
the default is the matlab character '%'.
An second optional argument can be add, to tell which columns you
want use in the file. This arguments is a list who contains the
number of columns beggining by 1.
matfile data is not currently supported, but see
Nigel Wade's matfile ftp://ion.le.ac.uk/matfile/matfile.tar.gz
Example usage:
x,y = load('test.dat') # data in two columns
X = load('test.dat') # a matrix of data
x = load('test.dat') # a single column of data
x = load('test.dat,'#') # the character use like a comment delimiter
is '#'
"""
if is_string_like(fname):
fh = file(fname)
elif hasattr(fname, 'seek'):
fh = fname
else:
raise ValueError('fname must be a string or file handle')
X = []
numCols = None
for line in fh:
line = line[:line.find(comments)].strip()
if not len(line): continue
row = [float(val) for val in line.split()]
thisLen = len(row)
if numCols is not None and thisLen != numCols:
raise ValueError('All rows must have the same number of
columns')
if columns is not None:
row = [row[i] for i in (array(columns)-1)]
X.append(row)
X = array(X)
r,c = X.shape
if r==1 or c==1:
X.shape = max([r,c]),
return transpose(X)
|
|
From: <seb...@sp...> - 2005-01-30 04:22:53
|
I have great working matplotlib pylab code that fires off a new plot when asked to. Now we want to embed/add this code into an existing wx gui....Is it possible to make the pylab code embed the plot into an existing gui window rather than creating a //new// plot window/widget? Also, a colleague says wx doesn't seem to play nice with pylab module. Is pylab somehow slower or not the best fit with wx?? He says 'Figure()' code seems better with wx. Any advice/comments greatly appreciated. Sincerely, Chris |
|
From: John H. <jdh...@ac...> - 2005-01-29 20:14:27
|
>>>>> "Alejandro" == Alejandro Weinstein <ale...@ya...> writes:
Alejandro> Hi : I hava a plot with mayor and minor ticks and
Alejandro> formatters. I want to rotate the labels of both the
Alejandro> mayor and minor ticks. I tried with the following code:
Alejandro> #... ax.xaxis.set_major_locator(major)
Alejandro> ax.xaxis.set_major_formatter(fmt_ma)
Alejandro> ax.xaxis.set_minor_locator(minor)
Alejandro> ax.xaxis.set_minor_formatter(fmt_mi) labels =
Alejandro> ax.get_xticklabels() pylab.set(labels, rotation=30,
Alejandro> fontsize=10)
Alejandro> However, only the mayor labels are rotated. How can I
Alejandro> rotate both the major and minor labels?
You can access the minor tick labels and minor tick labels by getting
a list of the minor ticks and accessing the label attribute
minlabels = [tick.label1 for tick in ax.xaxis.get_minor_ticks()]
The tick attributes are
tick1line : a Line2D instance
tick2line : a Line2D instance
gridline : a Line2D instance
label1 : an Text instance
label2 : an Text instance
gridOn : a boolean which determines whether to draw the tickline
tick1On : a boolean which determines whether to draw the 1st tickline
(left for xtick and bottom for yticks)
tick2On : a boolean which determines whether to draw the 2nd tickline
(left for xtick and bottom for yticks)
label1On : a boolean which determines whether to draw tick label
label2On : a boolean which determines whether to draw tick label
which is also documented at
http://matplotlib.sf.net/matplotlib.axis.html#Tick . The difference
between label1 and label2 is for left and right labeling for yticks,
and top and bottom labeling for xticks.
You can then call set on the list of labels to set the rotation,
etc...
Hope this helps.
JDH
|
|
From: Alejandro W. <ale...@ya...> - 2005-01-29 14:31:20
|
Hi : I hava a plot with mayor and minor ticks and formatters. I want to rotate the labels of both the mayor and minor ticks. I tried with the following code: #... ax.xaxis.set_major_locator(major) ax.xaxis.set_major_formatter(fmt_ma) ax.xaxis.set_minor_locator(minor) ax.xaxis.set_minor_formatter(fmt_mi) labels = ax.get_xticklabels() pylab.set(labels, rotation=30, fontsize=10) However, only the mayor labels are rotated. How can I rotate both the major and minor labels? Regards, Alejandro. __________________________________ Do you Yahoo!? The all-new My Yahoo! - Get yours free! http://my.yahoo.com |
|
From: John H. <jdh...@ac...> - 2005-01-29 00:36:48
|
>>>>> "Darren" == Darren Dale <dd...@co...> writes:
Darren> a1.imshow(z,cmap=cm.bone,extent=(0,1,0,1))
Darren> does not define a mappable image that colorbar can
Darren> locate. This will work:
Darren> axes(a1) imshow(z,cmap=cm.bone,extent=(0,1,0,1)).
Yes, currently the pylab interface manipulates the current mappable
and colorbar is a pylab only construct. These features are slated to
be ported into the object interface, where the current mappable will
likely be a figure property and the colorbar will be a figure method.
Glad you found the workaround for the time being...
JDH
|
|
From: John H. <jdh...@ac...> - 2005-01-28 20:42:42
|
>>>>> "Jochen" == Jochen Voss <vo...@se...> writes:
Jochen> Thank you for spotting this. I fixed it in CVS.
Great! Thanks.
Jochen> John: my fix contains the fancy expression
Jochen> re.sub(r"[^ -~\n]", lambda x: r"\%03o"%ord(x.group()),
Jochen> s)
Jochen> to quote all non-ASCII characters. Is this safe with all
Jochen> supported Python versions or do I need to be more portable
Jochen> here?
It looks valid to me across 2.2 - 2.4. The best solution though, is
to test it. How about a unit test called "whacky_chars" which makes
titles, xlabels and ylabels as if they came from a foul-mouthed comic
strip character. We could add this to unit test dir and test it
across backends.
Thanks,
JDH
|
|
From: Darren D. <dd...@co...> - 2005-01-28 20:42:35
|
On Friday 28 January 2005 02:51 pm, Darren Dale wrote:
> I am making graphics of some topographical images. Something simple like:
>
> from pylab import *
> z=rand(256,256)
> figure(figsize=(4,3))
> a1=axes([.1,.1,.7,.85])
> a2=axes([.85,.1,.05,.85])
> a2.yaxis.tick_right()
> a2.xaxis.set_ticks([])
>
> a1.imshow(z,cmap=cm.bone,extent=(0,1,0,1))
> colorbar('%1.1e',cax=a2)
>
> show()
>
> I am getting the jet colormap in the colorbar, is it possible to change it
> manually?
I found a workaround (or a work-a-right).
a1.imshow(z,cmap=cm.bone,extent=(0,1,0,1))
does not define a mappable image that colorbar can locate. This will work:
axes(a1)
imshow(z,cmap=cm.bone,extent=(0,1,0,1)).
Darren
|
|
From: Darren D. <dd...@co...> - 2005-01-28 20:19:42
|
I am making graphics of some topographical images. Something simple like:
from pylab import *
z=rand(256,256)
figure(figsize=(4,3))
a1=axes([.1,.1,.7,.85])
a2=axes([.85,.1,.05,.85])
a2.yaxis.tick_right()
a2.xaxis.set_ticks([])
a1.imshow(z,cmap=cm.bone,extent=(0,1,0,1))
colorbar('%1.1e',cax=a2)
show()
I am getting the jet colormap in the colorbar, is it possible to change it
manually?
Darren
|
|
From: Jochen V. <vo...@se...> - 2005-01-28 16:02:01
|
Hello Darren,
On Wed, Jan 26, 2005 at 03:08:17PM -0500, Darren Dale wrote:
> I can't render the eps file because of the way that "a)" is recorded ["(a=
)"=20
> will render, so its just a parsing issue]. I think, in the eps file "(a))=
=20
> show" should read "(a\)) show" for the image will render.
Thank you for spotting this. I fixed it in CVS.
John: my fix contains the fancy expression
re.sub(r"[^ -~\n]", lambda x: r"\%03o"%ord(x.group()), s)
to quote all non-ASCII characters. Is this safe with all supported
Python versions or do I need to be more portable here?
All the best,
Jochen
--=20
http://seehuhn.de/
|
|
From: John H. <jdh...@ac...> - 2005-01-28 15:00:16
|
>>>>> "Ye" == Ye Naiquan <Nai...@ma...> writes:
Ye> Helllo, I have been using matplotlib for some time (old
Ye> versions for python2.3).
Ye> After upgrading to python2.4 and nummarray and matplotlib
Ye> 0.71, the import pylab does not working.
...snip...
Ye> No module named Numeric
Ye> Anything I have done wrong? Still need Numeric?
No, you don't need Numeric, but you need to tell matplotlib to use
numarray.
http://matplotlib.sourceforge.net/faq.html#NUMARRAY
This is also covered in the "Numerix" section of the user's guide.
JDH
|
|
From: Jan R. G. <jr...@gm...> - 2005-01-28 07:18:58
|
i'm currently using python 2.3(enthought edition) on win 2000/xp. i'm using boa constructor on the GUI part and matplotlib 0.71 on plotting the graph. i am using an MDIParentFrame. one of the child frame will be used for the table part. then another child frame will be used to show the graph, how am i going to do this? will i just import the child frame containing the tables and then i'll be able to just get the data from the table and use it to plot a graph? how am i going to assign to a variable each input to the table? can you please show me a sample code to do this? i'm a little lost since i'm a bit new to python. also, how am i going to assign to a variable anything that a user inputs to a wxTxtCtrl? any help would greatly be appreciated. thanks and more power |