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
(13) |
2
(3) |
|
3
(4) |
4
(24) |
5
(12) |
6
(11) |
7
(14) |
8
(17) |
9
(3) |
|
10
(5) |
11
(23) |
12
(7) |
13
(9) |
14
(17) |
15
(1) |
16
(2) |
|
17
(2) |
18
(11) |
19
(14) |
20
(9) |
21
(13) |
22
(12) |
23
(1) |
|
24
|
25
(7) |
26
(11) |
27
(20) |
28
(19) |
29
(11) |
30
(1) |
|
From: Jeff W. <js...@fa...> - 2007-06-08 15:35:38
|
nappie74 wrote: > Hi, > I'm new in matplolib code, > I have matrix of winds vectors derivated from quiver introducing U,V > components,and positioning these in a sorted grid X,Y > with the command quiver (x, y, u, v,color='r') > It's possible to put in the figure the barbs to every arrow vector or > scaling the arrow with the values of its lenght derived by >>> r = > sqrt((U**2)+(V**2)) > Thanks a lot to averyone give me help > >> ----(^_^)----< >> > > Pie > Pie: quiver scales the vectors automatically, based upon their magnitude. See the docs at http://matplotlib.sourceforge.net/matplotlib.pylab.html#-quiver See in particular the 'scale' and 'units' keywords. The 'quiver_demo.py' might help too. If you're asking about wind barbs (http://www.rap.ucar.edu/weather/info/about_windbarb.html), there isn't currently a built-in facility for that in matplotlib. -Jeff -- Jeffrey S. Whitaker Phone : (303)497-6313 Meteorologist FAX : (303)497-6449 NOAA/OAR/PSD R/PSD1 Email : Jef...@no... 325 Broadway Office : Skaggs Research Cntr 1D-124 Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg |
|
From: Trevis C. <t_...@mr...> - 2007-06-08 14:58:04
|
Hi all,
=20
I have a plot of data that I am enabling the user to interact with.
That is, I want them to be able to pick a point, and then have a new
plot pop up in a different figure showing more info about that point.
=20
So, looking through the manual and the tutorial I have taken the code
from one of the examples and am trying to modify it to work for my
needs. Here's what I have so far:
=20
field =3D arrange(-1,1.25,0.25)
CA =3D cellArray() # this is an object defined elsewhere.
Ij =3D # a list of 2d arrays of data
=20
def state_picker(line, mouseevent):
if mouseevent.xdata is None:=20
return False, dict()
xdata =3D line.get_xdata()
ydata =3D line.get_ydata()
maxd =3D 0.1
d =3D nx.sqrt((xdata - mouseevent.xdata)**2. + (ydata -
mouseevent.ydata)**2.)
=20
ind =3D nx.nonzero(nx.less_equal(d, maxd))
if len(ind):
out =3D dict(ind=3Dind)
return True, out
else:
return False, dict()
=20
def onpick2(event,cellArray,Ij):
Ij =3D Ij[event.ind] # chose the list element from Ij
corresponds to the point selected by the user
cellArray.plot('flux',inputIj=3DIj) # the cellArray object =
has
its own plot method that requires these two arguments
=20
fig =3D figure()
ax1 =3D fig.add_subplot(111)
ax1.set_title('Energy States vs. Applied Flux per cell')
for i in range(len(field)):
# energy is a list of arrays of different length=20
ax1.plot(field[i]*ones(len(energy[i])),energy[i],'.b',
picker =3D state_picker)
ax1.set_xlim(-1.1,1.1)
ax1.set_xlabel('Applied Flux per cell')
ax1.set_ylabel('Array Energy (Ej)')
fig.canvas.mpl_connect('pick_event', onpick2)
show()
=20
=20
=20
The problem I'm having is that I can't seem to pass extra arguments to
either state_picker or onpick2. Can I?
=20
thanks for your help,
trevis
=20
________________________________________________
=20
Trevis Crane
Postdoctoral Research Assoc.
Department of Physics
University of Ilinois
1110 W. Green St.
Urbana, IL 61801
=20
p: 217-244-8652
f: 217-244-2278
e: tc...@ui...
________________________________________________
=20
|
|
From: John H. <jd...@gm...> - 2007-06-08 14:50:38
|
On 6/8/07, Lionel Roubeyrie <lro...@li...> wrote:
> Hi John,
> very very interesting idea.
> Is there a way to add some extras informations on the records arrays columns,
> like the units or/and the desired labels for the resulting plotted lines,
> directly retrieved in the CSV files?
It could be done, but my goal here is not to create a persistence
layer for record arrays, or a method of describing them or mpl labels,
but rather a way to easily import 3rd party CSV files into numpy
record arrays. I work with a lot of tab/space/ascii delimited files,
and found myself duplicating a lot of code importing them into record
arrays. This function is the distillation of that code. It would be
fairly easy to add designated rows for those who did want to decorate
their CSV files. I think it might be most useful to support a row
that provided a numpy dtype per column, or perhaps the name of a
converter function...
One thing people coming from gnuplot miss is file plotting
functionality. I just added a function to pylab called plotfile which
uses the csv2rec functionality (with autolabeling etc) to plot data
from a file. Eg,
>>> plotfile(fname, (0,5,6))
plots columns 5 and 6 against column 0. And
>>> plotfile(fname, ('date', 'volume', 'adj_close'),
plotfuncs={'volume': 'bar'})
does the same using the names of the columns, using "plot" for
adj_close (the default) and "bar" for volume (customization from the
plotfuncs dictionary). The column names in either case are used to
create default x and y labels.
The 2nd command produces the attached plot. This is just a first
pass, so if people want to see a different interface or have an
opinion what should be returned, or where this function should live
outside of pylab, feel free to comment or commit changes.
JDH
|
|
From: Sturla M. <st...@mo...> - 2007-06-08 14:27:53
|
There is an annoying bug when using wxAgg backend with wxPython 2.8 on
Windows. Whenever matplotlib is imported, we get a modal message box
displaying the error message:
"This application has failed to start because wxmsw26uh_vc.dll was not
found. Reinstalling the application may fix this problem."
After clicking OK, everything works fine.
Here is a bugfix:
_wxagg.pyd has a dependency on a unicode version of a "hybrid" (i.e.
debug) wxWidgets library, wxmsw26uh_vc.dll. I verified this using MSVC
dumpbin utility. No users of wxPython 2.8 will have this dll installed.
At the bottom of the file backends_wxagg.py, there is an import
statement for _wxagg.pyd:
try:
import _wxagg
except ImportError:
_wxagg = None
Obviously this import always fails on wxPython 2.8, and is the cause of
the redundant error message. _wxagg.pyd is not needed with wxPython 2.8,
so the import should not be attempted at all. Python will trap the
ImportError exception, but a redundant error message is displayed.
Instead, it should read like this:
if getattr(wx, '__version__', '0.0')[0:3] < '2.8':
try:
import _wxagg # C++ accelerator with wxPython 2.6
except ImportError:
_wxagg = None # default to pure Python
else: # wxPython 2.8, no accelerator needed
_wxagg = None
On wxPython 2.6, the C++ accelerator in _wxagg.pyd will not be used
unless _wxagg.pyd is linked against the xwWidgets library actually
present, and Python will default to Python code instead. Fixing these
issues on wxpython 2.6 thus require a rebuild of _wxagg.pyd that links
it with the wx library present on the system.
If all you need is to get rid of the error message, just comment out the
import statement and set the global variable _wxagg to None.
Regards,
Sturla Molden
|
|
From: nappie74 <nap...@ti...> - 2007-06-08 13:15:25
|
Hi, I'm new in matplolib code, I have matrix of winds vectors derivated from quiver introducing U,V components,and positioning these in a sorted grid X,Y with the command quiver (x, y, u, v,color='r') It's possible to put in the figure the barbs to every arrow vector or scaling the arrow with the values of its lenght derived by >>> r = sqrt((U**2)+(V**2)) Thanks a lot to averyone give me help >----(^_^)----< Pie -- View this message in context: http://www.nabble.com/to-build-barbs-in-quiver-resultant-vector-tf3889736.html#a11026235 Sent from the matplotlib - users mailing list archive at Nabble.com. |
|
From: Darren D. <dd...@co...> - 2007-06-08 11:45:06
|
On Thursday 07 June 2007 10:06:03 pm Stephan Bourduas wrote: > Hello, > > I've been using Matplotlib to generate postscript (eps) graphics which I > import into my latex documents. I tried using Latex to typeset > mathematical symbols on my plots using the steps described here: > > http://www.scipy.org/Cookbook/Matplotlib/UsingTex > > The problem (I think) is that the eps files are genrated using dvipng, > which results in ugly figures in the final PDF output. Is there a way to > get Matplotlib to *not* use dvipng as the backend? matplotlib only uses dvipng to render the text on screen in the plot window. Postscript file generation does not use dvipng. We paste in some tags and use the latex package psfrag to replace the tags with the text. > On the other hand, if I > uncomment the "rc('text', usetex=True)" line in the script so that Latex is > used for the fonts, I get the following when converting the resulting EPS > file to PDF: > > ======================= > $ ps2pdf test.eps > $ pdffonts test.pdf > name type emb sub uni object ID > ------------------------------------ ------------ --- --- --- --------- > > ======================= > > As you can see, there's no font embedding in this case and the image looks > bad when previewed in either Ghotsview (eps) or in PDF. Does anyone know > if it's possible to get Matplotlib + Latex font embedding to work? Unfortunately, psfrag produces postscript that can not be embedded in another file, so we have to distill the output. By default, the ghostscript distiller is used, but if you have pdftops (available with xpdf), you can set the ps.usedistiller option to xpdf and the fonts will be embedded. This is discussed at http://www.scipy.org/Cookbook/Matplotlib/UsingTex. Darren -- Darren S. Dale, Ph.D. dd...@co... |
|
From: Mark B. <ma...@gm...> - 2007-06-08 09:22:19
|
I know for a fact that it used to work for fill( [0,1,1], [0,0,1], '#FFFF66'). But maybe I was just lucky. It would be nice if you can make the change officially, Mark On 6/7/07, Eric Firing <ef...@ha...> wrote: > > Mark Bakker wrote: > > Hello - > > > > This used to work: > > fill( [0,1,1], [0,0,1], '#FFFF66') > > > > But it doesn't work anymore under 0.90.1. > > I thought it still worked under 0.90.0 > > I don't think this behavior is documented, and a very quick look at > recent changes to axes.py did not reveal a corresponding change, but it > looks like it would be easy add and it seems to me like a useful and > logical extension. The idea is that if a string is a valid mpl > colorspec (including, but not limited to, hex strings as in the example > above), then it sets the color; otherwise the present code is used to > interpret strings like '-k' etc. > > If no one is working on this, and if there is no objection, I can > implement it later today or tomorrow. Does anyone see any ambiguity or > other problem with this? > > Eric > > > > > Anybody see the same problem? > > Plot seems to have the same problem: > > plot([1,2,3],'#afeeee') > > > > Error message for the plot statement: > > Traceback (most recent call last): > > File "<pyshell#11>", line 1, in ? > > plot([1,2,3],'#afeeee') > > File "C:\Python24\Lib\site-packages\matplotlib\pylab.py", line 2028, > > in plot > > ret = gca().plot(*args, **kwargs) > > File "C:\Python24\Lib\site-packages\matplotlib\axes.py", line 2535, in > > plot > > for line in self._get_lines(*args, **kwargs): > > File "C:\Python24\Lib\site-packages\matplotlib\axes.py", line 421, in > > _grab_next_args > > for seg in self._plot_2_args(remaining, **kwargs): > > File "C:\Python24\Lib\site-packages\matplotlib\axes.py", line 313, in > > _plot_2_args > > linestyle, marker, color = _process_plot_format(fmt) > > File "C:\Python24\Lib\site-packages\matplotlib\axes.py", line 153, in > > _process_plot_format > > raise ValueError, err > > ValueError: Unrecognized character # in format string > > > > Thanks, Mark > > > > > > ------------------------------------------------------------------------ > > > > > ------------------------------------------------------------------------- > > This SF.net email is sponsored by DB2 Express > > Download DB2 Express C - the FREE version of DB2 express and take > > control of your XML. No limits. Just data. Click to get it now. > > http://sourceforge.net/powerbar/db2/ > > > > > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > Matplotlib-users mailing list > > Mat...@li... > > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > |
|
From: Lionel R. <lro...@li...> - 2007-06-08 07:08:19
|
Hi John,
very very interesting idea.
Is there a way to add some extras informations on the records arrays column=
s,=20
like the units or/and the desired labels for the resulting plotted lines,=20
directly retrieved in the CSV files?
Cordialy
Le jeudi 07 juin 2007, John Hunter a =E9crit=A0:
> I just added support for native plotting of python date and datetime
> objects (you still can, but don't have to use plot_date with date2num
> conversions). We will continue to do conversion to floats under the
> hood, but the conversion can be handled automagically. I also added
> support for loading CSV files (or general space/tab/comma delimited
> files) into numpy record arrays, and the type conversions (int, float,
> date, etc...) happen automagically. The function assumes there is a
> header row, and these strings will be munged to give valid python
> attribute names. It inspects the first checkrows lines after the
> header to try and infer the datatype and set the appropriate
> conversion function. It's not entirely bullet proof, but it should
> cover a lot of common use cases.
>
> Here is an example (svn only)
>
> from matplotlib.mlab import csv2rec
> from pylab import figure, show
>
> a =3D csv2rec('data/msft.csv')
> fig =3D figure()
> ax =3D fig.add_subplot(111)
> ax.plot(a.date, a.adj_close, '-')
> fig.autofmt_xdate()
> show()
>
> The autofmt_xdate is optional, but is a new function that does a few
> things you usually want in date plots: turns off tick labels in the
> upper subplots if any, rotates the tick labels on the lowest axes and
> right aligns them, and increases the bottom of the subplots adjust to
> make room for the rotated tick labels.
>
> Here is what the dtype looks like from the example above.
>
> In [3]: !head -3 data/msft.csv
> Date,Open,High,Low,Close,Volume,Adj. Close*
> 19-Sep-03,29.76,29.97,29.52,29.96,92433800,29.79
> 18-Sep-03,28.49,29.51,28.42,29.50,67268096,29.34
>
> In [4]: a =3D csv2rec('data/msft.csv')
>
> In [5]: a.dtype
> Out[5]: dtype([('date', '|O4'), ('open', '<f8'), ('high', '<f8'),
> ('low', '<f8'), ('close', '<f8'), ('volume', '<i4'), ('adj_close',
> '<f8')])
>
> In [6]: a.date[:2]
> Out[6]: array([2003-09-19 00:00:00, 2003-09-18 00:00:00], dtype=3Dobjec=
t)
>
> I'll probably add a few performance features to the csv2rec function,
> mainly to let you skip columns and supply conversion functions where
> desired because the autodate parser is pretty slow if you want to
> parse date strings, but this is enough to make it useful. Another
> useful feature will be able to support customizable type dependent
> NULL value conversion (eg convert to numpy.nan for floats,
> '0000-00-00' for dates, etc...)
>
> Record arrays are your friend; have fun!
> JDH
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
=2D-=20
Lionel Roubeyrie - lro...@li...
Chag=E9 d'=E9tudes et de maintenance
LIMAIR - la Surveillance de l'Air en Limousin
http://www.limair.asso.fr
|
|
From: Stephan B. <ste...@vi...> - 2007-06-08 02:06:09
|
Hello, I've been using Matplotlib to generate postscript (eps) graphics which I import into my latex documents. I tried using Latex to typeset mathematical symbols on my plots using the steps described here: http://www.scipy.org/Cookbook/Matplotlib/UsingTex The problem (I think) is that the eps files are genrated using dvipng, which results in ugly figures in the final PDF output. Is there a way to get Matplotlib to *not* use dvipng as the backend? For example. If I use the following simple script to generate a eps file ========================================= from matplotlib import rc import pylab from pylab import * import numarray as na params = { 'backend': 'ps', 'axes.titlesize': 24, 'axes.labelsize': 18, 'xtick.labelsize': 14, 'ytick.labelsize': 14, 'legend.fontsize': 14 } pylab.rcParams.update(params) #rc('text', usetex=True) N = 4 ind = arange(N) # the x locations for the groups width = 0.35 # the width of the bars data01 = (5, 10, 3, 2) data02 = (3, 7, 10, 6) title('Normal EPS Generation') p1 = bar(ind, data01, width, color='#CCCCFF') p2 = bar(ind+width, data02, width, color='#3399FF') xticks(ind+width, ('1', '2', '3', '4') ) xlim(-width,len(ind)) legend( (p1[0], p2[0]), ('data01', 'data02'), loc='upper right', shadow=False) pylab.savefig('test.eps') ============================================= I get a nice EPS file which looks good in my final PDF. Also, running ps2pdf and pdffonts shows that all the fonts are properly embedded in the eps file: ====================== $ ps2pdf test.eps $ pdffonts test.pdf name type emb sub uni object ID ------------------------------------ ------------ --- --- --- --------- NBOBDW+BitstreamVeraSans-Roman TrueType yes yes no 8 0 ======================= So as one would expect, the plots look good in the final PDF when zooming in and out because all the fonts are there. On the other hand, if I uncomment the "rc('text', usetex=True)" line in the script so that Latex is used for the fonts, I get the following when converting the resulting EPS file to PDF: ======================= $ ps2pdf test.eps $ pdffonts test.pdf name type emb sub uni object ID ------------------------------------ ------------ --- --- --- --------- ======================= As you can see, there's no font embedding in this case and the image looks bad when previewed in either Ghotsview (eps) or in PDF. Does anyone know if it's possible to get Matplotlib + Latex font embedding to work? Regards, Stephan |
|
From: Eric F. <ef...@ha...> - 2007-06-07 21:28:20
|
Mark Bakker wrote: > Hello - > > This used to work: > fill( [0,1,1], [0,0,1], '#FFFF66') > > But it doesn't work anymore under 0.90.1. > I thought it still worked under 0.90.0 I don't think this behavior is documented, and a very quick look at recent changes to axes.py did not reveal a corresponding change, but it looks like it would be easy add and it seems to me like a useful and logical extension. The idea is that if a string is a valid mpl colorspec (including, but not limited to, hex strings as in the example above), then it sets the color; otherwise the present code is used to interpret strings like '-k' etc. If no one is working on this, and if there is no objection, I can implement it later today or tomorrow. Does anyone see any ambiguity or other problem with this? Eric > > Anybody see the same problem? > Plot seems to have the same problem: > plot([1,2,3],'#afeeee') > > Error message for the plot statement: > Traceback (most recent call last): > File "<pyshell#11>", line 1, in ? > plot([1,2,3],'#afeeee') > File "C:\Python24\Lib\site-packages\matplotlib\pylab.py", line 2028, > in plot > ret = gca().plot(*args, **kwargs) > File "C:\Python24\Lib\site-packages\matplotlib\axes.py", line 2535, in > plot > for line in self._get_lines(*args, **kwargs): > File "C:\Python24\Lib\site-packages\matplotlib\axes.py", line 421, in > _grab_next_args > for seg in self._plot_2_args(remaining, **kwargs): > File "C:\Python24\Lib\site-packages\matplotlib\axes.py", line 313, in > _plot_2_args > linestyle, marker, color = _process_plot_format(fmt) > File "C:\Python24\Lib\site-packages\matplotlib\axes.py", line 153, in > _process_plot_format > raise ValueError, err > ValueError: Unrecognized character # in format string > > Thanks, Mark > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > > > ------------------------------------------------------------------------ > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
|
From: Andrew S. <str...@as...> - 2007-06-07 19:15:24
|
Marek, See the unicode_demo.py and the tex_unicode_demo.py in the examples directory. Marek Wojciechowski wrote: > Hi. > How can I get polish letters in, for example, plot title? Now I have empty > squares instead... > > Thanks in advance for any help. |
|
From: Marek W. <mwojc@p.lodz.pl> - 2007-06-07 17:38:37
|
Hi. How can I get polish letters in, for example, plot title? Now I have empty squares instead... Thanks in advance for any help. -- Marek Wojciechowski |
|
From: John H. <jd...@gm...> - 2007-06-07 16:54:05
|
I just added support for native plotting of python date and datetime
objects (you still can, but don't have to use plot_date with date2num
conversions). We will continue to do conversion to floats under the
hood, but the conversion can be handled automagically. I also added
support for loading CSV files (or general space/tab/comma delimited
files) into numpy record arrays, and the type conversions (int, float,
date, etc...) happen automagically. The function assumes there is a
header row, and these strings will be munged to give valid python
attribute names. It inspects the first checkrows lines after the
header to try and infer the datatype and set the appropriate
conversion function. It's not entirely bullet proof, but it should
cover a lot of common use cases.
Here is an example (svn only)
from matplotlib.mlab import csv2rec
from pylab import figure, show
a = csv2rec('data/msft.csv')
fig = figure()
ax = fig.add_subplot(111)
ax.plot(a.date, a.adj_close, '-')
fig.autofmt_xdate()
show()
The autofmt_xdate is optional, but is a new function that does a few
things you usually want in date plots: turns off tick labels in the
upper subplots if any, rotates the tick labels on the lowest axes and
right aligns them, and increases the bottom of the subplots adjust to
make room for the rotated tick labels.
Here is what the dtype looks like from the example above.
In [3]: !head -3 data/msft.csv
Date,Open,High,Low,Close,Volume,Adj. Close*
19-Sep-03,29.76,29.97,29.52,29.96,92433800,29.79
18-Sep-03,28.49,29.51,28.42,29.50,67268096,29.34
In [4]: a = csv2rec('data/msft.csv')
In [5]: a.dtype
Out[5]: dtype([('date', '|O4'), ('open', '<f8'), ('high', '<f8'),
('low', '<f8'), ('close', '<f8'), ('volume', '<i4'), ('adj_close',
'<f8')])
In [6]: a.date[:2]
Out[6]: array([2003-09-19 00:00:00, 2003-09-18 00:00:00], dtype=object)
I'll probably add a few performance features to the csv2rec function,
mainly to let you skip columns and supply conversion functions where
desired because the autodate parser is pretty slow if you want to
parse date strings, but this is enough to make it useful. Another
useful feature will be able to support customizable type dependent
NULL value conversion (eg convert to numpy.nan for floats,
'0000-00-00' for dates, etc...)
Record arrays are your friend; have fun!
JDH
|
|
From: Andrew S. <str...@as...> - 2007-06-07 16:51:32
|
Werner F. Bruhin wrote:
> Hi Andrew,
>
> Werner F. Bruhin wrote:
>
>> Hi Andrew,
>>
>> Andrew Straw wrote:
>>
>>
>>> Dear Werner,
>>>
>>> This seems to be an unintended side-effect of reorganizing the mpl
>>> data file location that I did prior to this release. (I.e. it's not
>>> your code that broke, I think it's mpl.) Unfortunately, since I didn't
>>> (and still don't) use py2exe, it will be hard for me to fix this. Can
>>> you send a patch that gets py2exe working again?
>>>
>>>
>> The work around I did is using glob.glob instead as follows:
>>
>> # matplotlib data
>> ##mpdir, mpfiles = matplotlib.get_py2exe_datafiles()
>> mpfiles = glob.glob('C:\Python25\lib\site-packages\matplotlib\mpl-data\*.*')
>>
>> But I can't confirm yet that this works as I am also trying out
>> something else in my InnoSetup script. Will confirm ASAP and will try
>> and look into matplotlib.get_py2exe_datafiles() and see how it could be
>> fixed.
>>
>>
> I have change matplotlib.get_py2exe_datafiles() to:
> def get_py2exe_datafiles():
> import glob
>
> mplfiles = []
> for item in glob.glob(os.sep.join([get_data_path(), '*/*'])):
> if os.path.isdir(item):
> mplfiles += glob.glob(os.sep.join([item, '/*']))
>
> mplfiles.append(os.sep.join([get_data_path(), 'matplotlibrc']))
>
> try:
> mplfiles.remove(os.sep.join([get_data_path(), 'Matplotlib.nib']))
> except:
> pass
>
> return ('matplotlibdata', mplfiles)
>
> Now this creates a "flat" folder, i.e. all datafiles are directly under
> matplotlibdata. In my tests this works for me in my limited tests, with
> the exception that I also get the "Could not match Bitstream Vera
> ......etc" error - but this is something I also get with py2exe, so I
> don't know if this is an issue.
>
> Andrew, do you know if the sub-folder structure should be retained when
> using py2exe for matplotlib to work correctly in all circumstances? If
> that would be the case let me know and I try to come up with something.
Dear Werner,
I am reluctant to eliminate the sub-folder structure because I think it
would add the possibility of unnecessary bugs to just the py2exe built
version. Would it be possible for you to re-factor this to include the
directory layout? When you test it, can you test some interactive plot
to make sure all the button icons are loaded properly?
Thanks,
Andrew
|
|
From: Matthew C. <mat...@gm...> - 2007-06-07 16:36:48
|
Hi Matplotlib users. I've been fiddling with colorbars a bit today and having a bit of difficulty with the borders. Take, for example, subplots_adjust.py: it makes nice colorbar up the side of the image. But there is a black border, plus numbers, around the colorbar. Is there an easy way of getting rid of the border, just leaving the blue to red scaled colorbar? Matthew |
|
From: fred <fr...@gm...> - 2007-06-07 10:02:38
|
Eric Firing a écrit :
> You may need to post a small code example so we can see what you are
> doing; but an interactive example using ipython -pylab may give you
> enough information to answer your question:
Hi ,
Not really ;-), but no problem.
I got a fix.
The trick is to pass axes colorbar as argument to colorbar function:
def update_colorbar(self):
if (self.cb is None):
self.cb = self.display.figure.colorbar(self.img,
ticks=self.cbticks,
format='%g')
else:
self.display.figure.colorbar(self.img,
self.cb.ax,
ticks=self.cbticks,
format='%g')
that works perfectly.
Cheers,
--
http://scipy.org/FredericPetit
|
|
From: Werner F. B. <wer...@fr...> - 2007-06-07 09:42:48
|
Hi Andrew,
Werner F. Bruhin wrote:
> Hi Andrew,
>
> Andrew Straw wrote:
>
>> Dear Werner,
>>
>> This seems to be an unintended side-effect of reorganizing the mpl
>> data file location that I did prior to this release. (I.e. it's not
>> your code that broke, I think it's mpl.) Unfortunately, since I didn't
>> (and still don't) use py2exe, it will be hard for me to fix this. Can
>> you send a patch that gets py2exe working again?
>>
> The work around I did is using glob.glob instead as follows:
>
> # matplotlib data
> ##mpdir, mpfiles = matplotlib.get_py2exe_datafiles()
> mpfiles = glob.glob('C:\Python25\lib\site-packages\matplotlib\mpl-data\*.*')
>
> But I can't confirm yet that this works as I am also trying out
> something else in my InnoSetup script. Will confirm ASAP and will try
> and look into matplotlib.get_py2exe_datafiles() and see how it could be
> fixed.
>
I have change matplotlib.get_py2exe_datafiles() to:
def get_py2exe_datafiles():
import glob
mplfiles = []
for item in glob.glob(os.sep.join([get_data_path(), '*/*'])):
if os.path.isdir(item):
mplfiles += glob.glob(os.sep.join([item, '/*']))
mplfiles.append(os.sep.join([get_data_path(), 'matplotlibrc']))
try:
mplfiles.remove(os.sep.join([get_data_path(), 'Matplotlib.nib']))
except:
pass
return ('matplotlibdata', mplfiles)
Now this creates a "flat" folder, i.e. all datafiles are directly under
matplotlibdata. In my tests this works for me in my limited tests, with
the exception that I also get the "Could not match Bitstream Vera
......etc" error - but this is something I also get with py2exe, so I
don't know if this is an issue.
Andrew, do you know if the sub-folder structure should be retained when
using py2exe for matplotlib to work correctly in all circumstances? If
that would be the case let me know and I try to come up with something.
Werner
|
|
From: Norbert N. <Nor...@gm...> - 2007-06-07 09:24:45
|
Just checked in an even cleaner solution: in _auto_legend_data, the internal routine get_handles() was overly compl= ex: first, it would merge lines, patches and linecollections into one list, only to then handle each kind separately. I simplified the code to avoid that issue, so get_handle only appears internally in Axes.legend() Jouni K. Sepp=E4nen wrote: > Norbert Nemec <Nor...@gm...> writes: > > =20 >> Thanks for the hint. I just fixed the problem in SVN. >> =20 > > I thought I had fixed this in March... see > http://thread.gmane.org/gmane.comp.python.matplotlib.devel/2574 > > But that was the get_handles() in legend.py, while this one is in > axes.py. Probably the code was originally copied from one place to the > other, but the functions have diverged since: one copy has had this > bug fixed, the other has been extended to handle RegularPolyCollections= =2E=20 > Perhaps get_handles() should be promoted from internal function to a=20 > method of Axes? > > Also, if someone were interested in creating a unit test suite for > matplotlib, a good way to start could be to identify the intended > types of member variables (e.g. "list of Line2D objects"), run various > example scripts and check that the variables have the correct kind of > data. > > =20 |
|
From: Mark B. <ma...@gm...> - 2007-06-07 07:49:43
|
Hello -
This used to work:
fill( [0,1,1], [0,0,1], '#FFFF66')
But it doesn't work anymore under 0.90.1.
I thought it still worked under 0.90.0
Anybody see the same problem?
Plot seems to have the same problem:
plot([1,2,3],'#afeeee')
Error message for the plot statement:
Traceback (most recent call last):
File "<pyshell#11>", line 1, in ?
plot([1,2,3],'#afeeee')
File "C:\Python24\Lib\site-packages\matplotlib\pylab.py", line 2028, in
plot
ret = gca().plot(*args, **kwargs)
File "C:\Python24\Lib\site-packages\matplotlib\axes.py", line 2535, in
plot
for line in self._get_lines(*args, **kwargs):
File "C:\Python24\Lib\site-packages\matplotlib\axes.py", line 421, in
_grab_next_args
for seg in self._plot_2_args(remaining, **kwargs):
File "C:\Python24\Lib\site-packages\matplotlib\axes.py", line 313, in
_plot_2_args
linestyle, marker, color = _process_plot_format(fmt)
File "C:\Python24\Lib\site-packages\matplotlib\axes.py", line 153, in
_process_plot_format
raise ValueError, err
ValueError: Unrecognized character # in format string
Thanks, Mark
|
|
From: <jk...@ik...> - 2007-06-07 06:04:38
|
Norbert Nemec <Nor...@gm...> writes: > Thanks for the hint. I just fixed the problem in SVN. I thought I had fixed this in March... see http://thread.gmane.org/gmane.comp.python.matplotlib.devel/2574 But that was the get_handles() in legend.py, while this one is in axes.py. Probably the code was originally copied from one place to the other, but the functions have diverged since: one copy has had this bug fixed, the other has been extended to handle RegularPolyCollections. Perhaps get_handles() should be promoted from internal function to a method of Axes? Also, if someone were interested in creating a unit test suite for matplotlib, a good way to start could be to identify the intended types of member variables (e.g. "list of Line2D objects"), run various example scripts and check that the variables have the correct kind of data. -- Jouni K. Seppänen http://www.iki.fi/jks |
|
From: Norbert N. <Nor...@gm...> - 2007-06-07 05:18:49
|
Thanks for the hint. I just fixed the problem in SVN. No idea how this problem would have popped up recently. I did some changes in legend just before 0.90.1, but I do not see how these would have caused the problem to show up. From what I see, the flaw should have been there all along. Well, whatever ... it is fixed now. Jessica Lu wrote: > Hi, > > I just downloaded and installed the latest matplotlib (0.90.1) and the > following problem occurred: > > > >>> > plot([0,1]) > scatter([0.5], [0.5]) > > # Should be one Line2D > print gca().lines > # Should be one RegularPolyCollection > print gca().collections > > # Now load a legend: > legend() > > # Should be one Line2D !!! BUT NOW THERE IS A RegularPolyCollection !!! > print gca().lines > # Should be one RegularPolyCollection > print gca().collections > > # Clearing throws the exception cuz it is trying to call > # line methods (get_xdata) on a poly-collection > clf() > >>> > > To fix this problem, I edited my axes.py file. In the legend() > function, there is a get_handles() function which does the following > (in psuedo code): > > handles = self.lines > handles.extend(self.patches) > handles.extend( --- collections ---) > > This is actually modifying the self.lines object. If instead I import > the copy module and do: > > handles = copy.copy(self.lines) > > then everything behaves better. I haven't done extensive testing to > see if this breaks anything else though. Is there some place to enter > bugs or is posting to this mailing list good enough? > > Cheers, > Jessica > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > ------------------------------------------------------------------------ > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
|
From: Sam V. <vo...@gm...> - 2007-06-07 05:12:49
|
I'm trying to replicate a plot like this: http://tinyurl.com/2uwjn8 In this case, the y-axis on the left (the black dots) is linear (thought the values are logged) and the y-axis on the right (red data) is log base 2. I'm running into some problems. 1. How do I display the right-hand y-axis so that is includes the range above 32 and below 0? When I try to include 0 or below in the axis range, I get an error. When I do auto, it ranged from 2 to 32. 2. How do I line up the centers of both axes. in this case, the y-axis on the left needs to have the 0 value lined up with the value of 2 on the y axis on the right. 3. I can't get matplotlib to make such small dots (like the black dots in this figure). Is that possible? Thanks for the advice. |
|
From: Jessica Lu <jl...@as...> - 2007-06-07 02:52:10
|
Hi, I just downloaded and installed the latest matplotlib (0.90.1) and the following problem occurred: >>> plot([0,1]) scatter([0.5], [0.5]) # Should be one Line2D print gca().lines # Should be one RegularPolyCollection print gca().collections # Now load a legend: legend() # Should be one Line2D !!! BUT NOW THERE IS A RegularPolyCollection !!! print gca().lines # Should be one RegularPolyCollection print gca().collections # Clearing throws the exception cuz it is trying to call # line methods (get_xdata) on a poly-collection clf() >>> To fix this problem, I edited my axes.py file. In the legend() function, there is a get_handles() function which does the following (in psuedo code): handles = self.lines handles.extend(self.patches) handles.extend( --- collections ---) This is actually modifying the self.lines object. If instead I import the copy module and do: handles = copy.copy(self.lines) then everything behaves better. I haven't done extensive testing to see if this breaks anything else though. Is there some place to enter bugs or is posting to this mailing list good enough? Cheers, Jessica |
|
From: Eric F. <ef...@ha...> - 2007-06-06 23:44:15
|
fred wrote: > Hi, > > My issue is quite simple: I reload several times an image > with the colorbar enabled, and thus, I have several colorbars, not only one. > > How can I disable this, and thus, get only one colorbar ? > > Cheers, > You may need to post a small code example so we can see what you are doing; but an interactive example using ipython -pylab may give you enough information to answer your question: im = imshow(rand(20,20)) colorbar() im.set_data(rand(20,20)) draw() im.set_data(rand(20,20)*5) im.autoscale() # to change the colormap limits draw() etc.... Eric |
|
From: Nicolas <nic...@ya...> - 2007-06-06 20:14:58
|
I can't figure why Polygons are used even when I simply draw lines.
But I know at least why I use empty list of vertices. ;)
In fact, I use matplotlib for a dynamic geometry software (something like
GeoGebra), and systematic use of high-level functions of matplotlib would be
to slow for that purpose.
And yet, I didn't want to use too low-level functions, like the renderer's
ones, for I didn't want to depend too much of a particular renderer.
So, I created once a set of plots and fills for every object, and then I
modified its attributes . I used to set its vertices to an empty list when I
didn't want it to appear on the figure.
I suppose now I'd better use instead something like.
my_plot._visible = False
Nevertheless, I think empty vertices should be supported here (or not
supported at all for all renderers - for in 0.90.1 it still works with tkagg
for example)
Nicolas
On 6/6/07, John Hunter <jd...@gm...> wrote:
>
> On 6/6/07, Nicolas <nic...@ya...> wrote:
>
> > Unfortunately, I didn't use instantiated Polygon items myself, so for
> now I
> > can't figure which part of my code produces indirectly such empty
> > Polygons...
> >
> > May it be however possible to modify a little matplotlib code, so as to
> > assure the compatibility with the previous existing versions of
> matplotlib ?
> > Something like :
>
> I don't have a problem with this, but it just makes it easier for
> latent bugs in your code to remain hidden. Should we raise in the
> Polygon constructor is you pass in an empty list of vertices? Of
> course, you can always set xy directly, so this won't catch all the
> errors unless we use properties or traits.
>
> JDH
>
|