SourceForge logo
SourceForge logo
Menu

matplotlib-users — Discussion related to using matplotlib

You can subscribe to this list here.

2003 Jan
Feb
Mar
Apr
May
(3)
Jun
Jul
Aug
(12)
Sep
(12)
Oct
(56)
Nov
(65)
Dec
(37)
2004 Jan
(59)
Feb
(78)
Mar
(153)
Apr
(205)
May
(184)
Jun
(123)
Jul
(171)
Aug
(156)
Sep
(190)
Oct
(120)
Nov
(154)
Dec
(223)
2005 Jan
(184)
Feb
(267)
Mar
(214)
Apr
(286)
May
(320)
Jun
(299)
Jul
(348)
Aug
(283)
Sep
(355)
Oct
(293)
Nov
(232)
Dec
(203)
2006 Jan
(352)
Feb
(358)
Mar
(403)
Apr
(313)
May
(165)
Jun
(281)
Jul
(316)
Aug
(228)
Sep
(279)
Oct
(243)
Nov
(315)
Dec
(345)
2007 Jan
(260)
Feb
(323)
Mar
(340)
Apr
(319)
May
(290)
Jun
(296)
Jul
(221)
Aug
(292)
Sep
(242)
Oct
(248)
Nov
(242)
Dec
(332)
2008 Jan
(312)
Feb
(359)
Mar
(454)
Apr
(287)
May
(340)
Jun
(450)
Jul
(403)
Aug
(324)
Sep
(349)
Oct
(385)
Nov
(363)
Dec
(437)
2009 Jan
(500)
Feb
(301)
Mar
(409)
Apr
(486)
May
(545)
Jun
(391)
Jul
(518)
Aug
(497)
Sep
(492)
Oct
(429)
Nov
(357)
Dec
(310)
2010 Jan
(371)
Feb
(657)
Mar
(519)
Apr
(432)
May
(312)
Jun
(416)
Jul
(477)
Aug
(386)
Sep
(419)
Oct
(435)
Nov
(320)
Dec
(202)
2011 Jan
(321)
Feb
(413)
Mar
(299)
Apr
(215)
May
(284)
Jun
(203)
Jul
(207)
Aug
(314)
Sep
(321)
Oct
(259)
Nov
(347)
Dec
(209)
2012 Jan
(322)
Feb
(414)
Mar
(377)
Apr
(179)
May
(173)
Jun
(234)
Jul
(295)
Aug
(239)
Sep
(276)
Oct
(355)
Nov
(144)
Dec
(108)
2013 Jan
(170)
Feb
(89)
Mar
(204)
Apr
(133)
May
(142)
Jun
(89)
Jul
(160)
Aug
(180)
Sep
(69)
Oct
(136)
Nov
(83)
Dec
(32)
2014 Jan
(71)
Feb
(90)
Mar
(161)
Apr
(117)
May
(78)
Jun
(94)
Jul
(60)
Aug
(83)
Sep
(102)
Oct
(132)
Nov
(154)
Dec
(96)
2015 Jan
(45)
Feb
(138)
Mar
(176)
Apr
(132)
May
(119)
Jun
(124)
Jul
(77)
Aug
(31)
Sep
(34)
Oct
(22)
Nov
(23)
Dec
(9)
2016 Jan
(26)
Feb
(17)
Mar
(10)
Apr
(8)
May
(4)
Jun
(8)
Jul
(6)
Aug
(5)
Sep
(9)
Oct
(4)
Nov
Dec
2017 Jan
(5)
Feb
(7)
Mar
(1)
Apr
(5)
May
Jun
(3)
Jul
(6)
Aug
(1)
Sep
Oct
(2)
Nov
(1)
Dec
2018 Jan
Feb
Mar
Apr
(1)
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
2020 Jan
Feb
Mar
Apr
May
(1)
Jun
Jul
Aug
Sep
Oct
Nov
Dec
2025 Jan
(1)
Feb
Mar
Apr
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
S M T W T F S





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

Showing results of 356

<< < 1 2 3 4 5 6 .. 15 > >> (Page 4 of 15)
From: Darren D. <dar...@co...> - 2008年02月27日 14:24:20
Hi Jochen,
I don't see the problem here with either 0.91.2, the maintanance branch, or 
the development branch. Maybe I dont know what I am looking for. Could you 
please send me an eps and png example so I can compare my results with yours? 
On Monday 25 February 2008 04:53:47 pm Jochen Voss wrote:
> Hi,
>
> I have a strange (to me) problem with matplotlib version 0.91.2,
> installed from source on a Debian Linux system.
>
> I try to generate a plot which combines bitmap data (using "pcolor")
> and some lines (using "plot") as in the appended script. I switch off
> the coordinate axes using the command axis("off") and I try to set the
> displayed coordinate range using the command
>
> axis([x0-p, x1+p, y0-p, y1+p])
>
> near the end of the script.
>
> Problem: the output of this script, i.e. the file "out.eps" is
> shifted. To me it seems that the PostScript bounding box is wrong.
>
> Some things I noticed:
>
> 1) It seems that the pixel data from the pcolor command is centred in
> the boundign box. If I plot the pcolor output at different locations,
> the bounding box changes. This seems wrong to me, because I expect
> the bounding box to be determined by the above axis command.
>
> 2) If I comment out the axis("off") command, the output is no longer
> shifted and looks perfect, except that it now has the unwanted
> coordinate axes.
>
> 3) If I output an .png file, using the Agg backend, the problem does
> not appear. This does not help, since I need an .eps file.
>
> My questions: What am I doing wrong? How do I get an unshifted .eps
> file without coordinate axes? Any help would be very welcome.
>
> Many thanks in advance,
> Jochen
>
> == script starts next line ===========================================
> #! /usr/bin/env python
>
> import matplotlib
> matplotlib.use("PS")
> from pylab import *
>
> def create_hist():
> X = array([-2.3, -2.0, -1.7 ])
> Y = array([-0.3, -0.0, 0.3 ])
> hist = array([[ 0.2, 0.4 ], [ 0.6, 0.8 ]])
> return X, Y, hist
>
> def generate_figure(fname, X, Y, hist, stamp=None):
> width = 4.5
> height = 1.6
> margin = 0.05
> padding = 0.05
>
> x0 = -3.3
> x1 = 4.0
> q = (x1-x0)/(width - 2*margin - 2*padding)
> y0 = -0.3
> y1 = y0 + (height - 2*margin - 2*padding)*q
>
> # create an appropriately sized figure
> rc('text', usetex=True)
> rc('font', family="serif", serif="Times", size=12.0)
> rc('xtick', labelsize=12)
> rc('ytick', labelsize=12)
> rc('figure.subplot', left=margin/width)
> rc('figure.subplot', right=(width-margin)/width)
> rc('figure.subplot', bottom=margin/height)
> rc('figure.subplot', top=(height-margin)/height)
> fig = figure(figsize=(width, height))
> ax = axes([margin/width, margin/height,
> (width-2*margin)/width, (height-2*margin)/height])
> p = q*padding
>
> # plot the density data
> mycmdata = {
> 'red': ((0., 1.0, 1.0), (0.01, 0.95, 0.95), (1.0, 0.0, 0.0)),
> 'green': ((0., 1.0, 1.0), (0.01, 0.95, 0.95), (1.0, 0.0, 0.0)),
> 'blue': ((0., 1.0, 1.0), (0.01, 0.95, 0.95), (1.0, 0.0, 0.0)),
> }
> mycm = matplotlib.colors.LinearSegmentedColormap('mycm', mycmdata)
> pcolor(X, Y, hist, cmap=mycm, shading='flat')
>
> # plot the corner
> plot([x0, x0, x1], [y1, y0, y0], "k-")
> plot([x0+0.6, x0+0.6, x1], [y1, y0+0.6, y0+0.6], "k-")
>
> # place the stamp
> if stamp is not None:
> text(x1-p, y1-p, stamp, va='top', ha='right')
>
> # save the result
> axis([x0-p, x1+p, y0-p, y1+p])
> axis("off")
> savefig(fname, facecolor="yellow")
>
> X, Y, hist = create_hist()
> generate_figure("out.eps", X, Y, hist, "$t=1$")
-- 
Darren S. Dale, Ph.D.
Staff Scientist
Cornell High Energy Synchrotron Source
Cornell University
275 Wilson Lab
Rt. 366 & Pine Tree Road
Ithaca, NY 14853
dar...@co...
office: (607) 255-3819
fax: (607) 255-9001
http://www.chess.cornell.edu
From: Michaël D. <mic...@la...> - 2008年02月27日 09:57:09
Hi list
I searched the list and google, but couldn't find a way to solve my pbm.
I have data stored in a list (from an sql query) , with these "columns":
x = time serie in hours
y = some level value
There are some missing values : eg between 08:33 and 08:40.
Here is my code :
 sqla="SELECT * FROM import_parcelle a WHERE dat_loc='" + date_traite 
+ "' AND code_uc='" + code_uc + "' ORDER BY a.heu_loc ;"
 resa=db.query(sqla)
 data=resa.dictresult() 
#x = time serie
 x= [ datetime.datetime(*time.strptime(a["dat_loc"]+" 
"+a["heu_loc"],'%Y-%m-%d %H:%M:%S')[0:6] ) for a in data]
#y5 = tank level
 y5= [float(a["niv_cuv"]) for a in data] # --> extraction de la 
colonne y1
 figure()
# the plot command with no mask
 
plot_date(x,y5,color='b',linestyle='None',marker='',xdate=True,ydate=False)
#the mask
 #ym5 = ma.masked_where(y5 <300, y5)
 #plot_date(x,ym5,color='r',linestyle='-',xdate=True,ydate=False)
#the filling under the curve
 xs, ys = poly_between(x, 0, y5)
 fill(xs,ys)
Here is the result:
http://michaeldouchin.free.fr/17_2007年06月07日_10B_vitesse.png
As you see, I commented the lines with the mask, because it did not 
change anything
To see what I am looking for, here is the result under R (a statistical 
tool)
http://michaeldouchin.free.fr/17_2007年06月07日_10B_vitesse.jpg
As you see, between 08:48 and 08:50 (for example), there is a gap, 
showing we have no data for this interval.
As I want to automatically draw this graph for different set of data, I 
can't look each set in detail.
I tried to folow the example masked_demo.py, but I could not adapt it to 
my case....
Any hint ?
Thanks very much in advance
Michael
From: LB <bra...@gm...> - 2008年02月27日 06:57:32
I'm still investigating for my segmentation fault pb with matplotlib and
Tkagg,
but now, I have no more idea.
Here is a summary of my investigations :
 =============
 CONFIGURATION
 =============
I'm trying to make a local installation of the following programs on a
GNU/Linux i686 (32 bits) :
 - gcc-4.2.3
 - tcl8.5.1
 - tk8.5.1
 - Python-2.5.2
 - numpy-1.0.4
 - scipy-0.6
 - matplotlib-0.91.2
I used the option --prefix=${INSTALL_DIR} everywhere, and I compiled gcc,
tcl
tk and Python with the options --enable-shared --enable-threads. For
building
numpy, scipy and matplotlib, I defined a shell varaible named python in
order
to call the python version installed in $INSTALL_DIR.
All compilation are made from the official source tarballs.
I haven't seen any compilation problem in the log of theses compilations,
and
all tests are running fine.
 ======================
 INSTALLING MATPLOTLIB
 ======================
I've put verbose=True in my setup.cfg file (but didn't see a lot of change
with that) :
$ cat setup.cfg
[ status ]
verbose=True
$python setup.py install --prefix=${INSTALL_DIR}
-------------------------------------------------------------------------------
BUILDING MATPLOTLIB
 matplotlib: 0.91.2
 python: 2.5.2 (r252:60911, Feb 26 2008, 22:21:12) [GCC
 4.2.3]
 platform: linux2
REQUIRED DEPENDENCIES
 numpy: 1.0.4
 freetype2: 9.16.3
OPTIONAL BACKEND DEPENDENCIES
 libpng: 1.2.15beta5
 Tkinter: Tkinter: 50704, Tk: 8.5, Tcl: 8.5
 wxPython: no
 * wxPython not found
 Gtk+: no
 * Building for Gtk+ requires pygtk; you must be able
 * to "import gtk" in your build/install environment
 Qt: no
 Qt4: no
 Cairo: no
OPTIONAL DATE/TIMEZONE DEPENDENCIES
 datetime: present, version unknown
 dateutil: matplotlib will provide
 pytz: matplotlib will provide
OPTIONAL USETEX DEPENDENCIES
 dvipng: 1.9
 ghostscript: 8.15.3
 latex: 3.141592
 pdftops: 3.00
EXPERIMENTAL CONFIG PACKAGE DEPENDENCIES
 configobj: matplotlib will provide
 enthought.traits: matplotlib will provide
[Edit setup.cfg to suppress the above messages]
------------------------------------------------------------------------------
I didn't see any compilation error, only a lot of messages saying :
"""
cc1plus: attention : l'option de la ligne de commande "-Wstrict-prototypes"
est
valide pour Ada/C/ObjC mais pas pour C++
"""
 ==================
 TESTING MATPLOTLIB
 ==================
$ source setenv_bash # setup environment to call the local version of
python
$ cat test.py
from pylab import *
plot([1, 2, 3])
show()
$ python2.5 test.py --verbose-debug-annoying
$HOME=/home/loic
CONFIGDIR=/home/loic/.matplotlib
matplotlib data path
/home/loic/tmp/bluelagoon/lib/python2.5/site-packages/matplotlib/mpl-data
loaded rc file /home/loic/.matplotlib/matplotlibrc
matplotlib version 0.91.2
verbose.level debug-annoying
interactive is False
units is True
platform is linux2
loaded modules: ['_bisect', 'xml.sax.urlparse', 'distutils', 'pylab',
 'datetime', 'matplotlib.tempfile', 'distutils.sysconfig',
 'encodings.encodings', 'pytz.cStringIO', 'xml', 'struct', 'tempfile',
 'xml.sax.urllib', '_struct', 'pytz.os', 'matplotlib.matplotlib',
 'string', 'encodings.utf_8', 'matplotlib.__future__', 'pytz.tzinfo',
 'pytz.datetime', 'distutils.re', 'bisect', 'signal', 'random',
 'xml.sax.xmlreader', 'matplotlib.pytz', 'pytz.tzfile', 'cStringIO',
 'locale', 'xml.sax.saxutils', 'encodings', 'dateutil',
 'matplotlib.warnings', 'matplotlib.string', 'pytz.pytz', 'urllib',
 'matplotlib.sys', 're', 'math', 'fcntl', 'UserDict', 'distutils.os',
 'matplotlib', 'codecs', 'md5', '_locale', 'matplotlib.sre_constants',
 'matplotlib.os', 'thread', 'weakref', 'itertools', 'distutils.sys',
 'os', 'sre_parse', '__future__', 'matplotlib.copy', 'xml.sax.types',
 '_sre', '__builtin__', 'matplotlib.re', 'operator', 'distutils.string
',
 'matplotlib.datetime', 'posixpath', 'errno', '_socket', 'binascii',
 'sre_constants', 'matplotlib.md5', 'types', 'pytz.sys',
 'xml.sax.handler', 'xml.sax.os', 'matplotlib.xml', '_codecs', 'pytz',
 'matplotlib.pyparsing', 'copy', 'socket', '_types',
 'matplotlib.dateutil', 'hashlib', 'posix', 'encodings.aliases',
 'matplotlib.fontconfig_pattern', 'exceptions', 'xml.sax._exceptions',
 'pytz.bisect', 'distutils.distutils', 'copy_reg', 'sre_compile',
 'xml.sax', '_hashlib', '_random', 'pytz.struct', 'site', 'zipimport',
 '__main__', 'shutil', 'matplotlib.weakref', 'strop', '
encodings.codecs',
 'gettext', 'matplotlib.rcsetup', 'pytz.sets', 'xml.sax.codecs',
'stat',
 '_ssl', 'warnings', 'encodings.types', 'sets', 'sys', 'xml.sax.sys',
 'os.path', 'pytz.gettext', 'matplotlib.distutils', '_weakref',
 'distutils.errors', 'urlparse', 'linecache', 'matplotlib.shutil',
 'time']
numerix numpy 1.0.4
Using fontManager instance from /home/loic/.matplotlib/fontManager.cache
backend TkAgg version 8.5
FigureCanvasAgg.draw
RendererAgg.__init__
RendererAgg.__init__ width=650.0, height=490.0
RendererAgg.__init__ _RendererAgg done
RendererAgg.__init__ done
RendererAgg._get_agg_font
 findfont found Bitstream Vera Sans, normal, normal 400, normal, 12.0
findfont returning
/home/loic/tmp/bluelagoon/lib/python2.5/site-packages/matplotlib/mpl-data/fonts/ttf/Vera.ttf
RendererAgg._get_agg_font
RendererAgg.draw_text
RendererAgg._get_agg_font
RendererAgg.points_to_pixels
RendererAgg.points_to_pixels
RendererAgg._get_agg_font
RendererAgg._get_agg_font
RendererAgg.draw_text
RendererAgg._get_agg_font
RendererAgg.points_to_pixels
RendererAgg.points_to_pixels
RendererAgg._get_agg_font
RendererAgg._get_agg_font
RendererAgg.draw_text
RendererAgg._get_agg_font
RendererAgg.points_to_pixels
RendererAgg.points_to_pixels
RendererAgg._get_agg_font
RendererAgg._get_agg_font
RendererAgg.draw_text
RendererAgg._get_agg_font
RendererAgg._get_agg_font
RendererAgg._get_agg_font
RendererAgg.draw_text
RendererAgg._get_agg_font
RendererAgg._get_agg_font
RendererAgg._get_agg_font
RendererAgg.draw_text
RendererAgg._get_agg_font
RendererAgg.points_to_pixels
RendererAgg.points_to_pixels
RendererAgg._get_agg_font
RendererAgg._get_agg_font
RendererAgg.draw_text
RendererAgg._get_agg_font
RendererAgg.points_to_pixels
RendererAgg.points_to_pixels
RendererAgg._get_agg_font
RendererAgg._get_agg_font
RendererAgg.draw_text
RendererAgg._get_agg_font
RendererAgg.points_to_pixels
RendererAgg.points_to_pixels
RendererAgg._get_agg_font
RendererAgg._get_agg_font
RendererAgg.draw_text
RendererAgg._get_agg_font
RendererAgg._get_agg_font
RendererAgg._get_agg_font
RendererAgg.draw_text
RendererAgg._get_agg_font
Erreur de segmentation
 ===========
 RUNNING GDB
 ===========
$ gdb python2.5
GNU gdb 6.7.1-debian
Copyright (C) 2007 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html
>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i486-linux-gnu"...
Using host libthread_db library "/lib/i686/cmov/libthread_db.so.1".
(gdb) run
Starting program: /home/loic/tmp/bluelagoon/bin/python2.5
[Thread debugging using libthread_db enabled]
Python 2.5.2 (r252:60911, Feb 26 2008, 22:21:12)
[GCC 4.2.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
[New Thread 0xb7c40ad0 (LWP 20090)]
>>> from pylab import *
[New Thread 0xb6916b90 (LWP 20093)]
>>> plot([1, 2, 3])
[<matplotlib.lines.Line2D instance at 0x889d24c>]
>>> show()
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb7c40ad0 (LWP 20090)]
PyAggImagePhoto (clientdata=0x0, interp=0x881a068, argc=5, argv=0x8a3d318)
at src/_transforms.h:362
362 Point* ll_api() {return _ll;}
Current language: auto; currently c++
(gdb) bt
#0 PyAggImagePhoto (clientdata=0x0, interp=0x881a068, argc=5,
argv=0x8a3d318) at src/_transforms.h:362
#1 0xb6a81a06 in TclInvokeStringCommand () from
/home/loic/tmp/bluelagoon/lib/libtcl8.5.so
#2 0xb6a8277c in TclEvalObjvInternal () from
/home/loic/tmp/bluelagoon/lib/libtcl8.5.so
#3 0xb6a8361e in Tcl_EvalObjv () from
/home/loic/tmp/bluelagoon/lib/libtcl8.5.so
#4 0xb6d72186 in Tkapp_Call (selfptr=0x8892288, args=0x8801f8c) at
/home/loic/tmp/bluelagoon/src/Python-2.5.2/Modules/_tkinter.c:1327
#5 0xb7e4c238 in PyCFunction_Call (func=0x889d66c, arg=0x8801f8c, kw=0x0)
at Objects/methodobject.c:108
#6 0xb7e99ed6 in PyEval_EvalFrameEx (f=0x8b0118c, throwflag=0) at
Python/ceval.c:3573
#7 0xb7e9b668 in PyEval_EvalCodeEx (co=0x8804b18, globals=0x886224c,
locals=0x0, args=0x8abc724, argcount=2, kws=0x8abc72c, kwcount=1,
 defs=0x85735b8, defcount=2, closure=0x0) at Python/ceval.c:2836
#8 0xb7e99bbc in PyEval_EvalFrameEx (f=0x8abc5e4, throwflag=0) at
Python/ceval.c:3669
#9 0xb7e9b668 in PyEval_EvalCodeEx (co=0x87d37b8, globals=0x87d52d4,
locals=0x0, args=0x8abc108, argcount=1, kws=0x8abc10c, kwcount=0,
 defs=0x0, defcount=0, closure=0x0) at Python/ceval.c:2836
#10 0xb7e99bbc in PyEval_EvalFrameEx (f=0x8abbfb4, throwflag=0) at
Python/ceval.c:3669
#11 0xb7e9b668 in PyEval_EvalCodeEx (co=0x87d3770, globals=0x87d52d4,
locals=0x0, args=0x854ed78, argcount=2, kws=0x0, kwcount=0,
 defs=0x0, defcount=0, closure=0x0) at Python/ceval.c:2836
#12 0xb7e3841f in function_call (func=0x889002c, arg=0x854ed6c, kw=0x0) at
Objects/funcobject.c:517
#13 0xb7e166e7 in PyObject_Call (func=0x6, arg=0x854ed6c, kw=0x0) at
Objects/abstract.c:1861
#14 0xb7e97c07 in PyEval_EvalFrameEx (f=0x8abb684, throwflag=0) at
Python/ceval.c:3853
#15 0xb7e9b668 in PyEval_EvalCodeEx (co=0x87f39b0, globals=0x87d5d74,
locals=0x0, args=0xb7c07720, argcount=20, kws=0x0, kwcount=0,
 defs=0x0, defcount=0, closure=0x0) at Python/ceval.c:2836
#16 0xb7e3841f in function_call (func=0x8859684, arg=0xb7c07714, kw=0x0) at
Objects/funcobject.c:517
#17 0xb7e166e7 in PyObject_Call (func=0x6, arg=0xb7c07714, kw=0x0) at
Objects/abstract.c:1861
#18 0xb7e1de98 in instancemethod_call (func=0x8859684, arg=0xb7c07714,
kw=0x0) at Objects/classobject.c:2519
#19 0xb7e166e7 in PyObject_Call (func=0x6, arg=0x876bc5c, kw=0x0) at
Objects/abstract.c:1861
#20 0xb7e92eac in PyEval_CallObjectWithKeywords (func=0x836caa4,
arg=0x876bc5c, kw=0x0) at Python/ceval.c:3442
#21 0xb6d71082 in PythonCmd (clientData=0x8918010, interp=0x881a068,
argc=20, argv=0x8a3d2bc)
 at /home/loic/tmp/bluelagoon/src/Python-2.5.2/Modules/_tkinter.c:2014
#22 0xb6a81a06 in TclInvokeStringCommand () from
/home/loic/tmp/bluelagoon/lib/libtcl8.5.so
#23 0xb6a8277c in TclEvalObjvInternal () from
/home/loic/tmp/bluelagoon/lib/libtcl8.5.so
#24 0xb6ac8325 in TclExecuteByteCode () from
/home/loic/tmp/bluelagoon/lib/libtcl8.5.so
#25 0xb6ad106c in Tcl_ExprObj () from
/home/loic/tmp/bluelagoon/lib/libtcl8.5.so
#26 0xb6a814a3 in Tcl_ExprBooleanObj () from
/home/loic/tmp/bluelagoon/lib/libtcl8.5.so
#27 0xb6a9435c in Tcl_IfObjCmd () from
/home/loic/tmp/bluelagoon/lib/libtcl8.5.so
#28 0xb6a8277c in TclEvalObjvInternal () from
/home/loic/tmp/bluelagoon/lib/libtcl8.5.so
#29 0xb6a8321a in TclEvalEx () from
/home/loic/tmp/bluelagoon/lib/libtcl8.5.so
#30 0xb6a8346e in Tcl_EvalEx () from
/home/loic/tmp/bluelagoon/lib/libtcl8.5.so
#31 0xb6b72c94 in Tk_BindEvent () from
/home/loic/tmp/bluelagoon/lib/libtk8.5.so
#32 0xb6b786d1 in TkBindEventProc () from
/home/loic/tmp/bluelagoon/lib/libtk8.5.so
#33 0xb6b7e827 in Tk_HandleEvent () from
/home/loic/tmp/bluelagoon/lib/libtk8.5.so
#34 0xb6b9b196 in TkDoConfigureNotify () from
/home/loic/tmp/bluelagoon/lib/libtk8.5.so
#35 0xb6b9b9f7 in Tk_MakeWindowExist () from
/home/loic/tmp/bluelagoon/lib/libtk8.5.so
#36 0xb6b9baf8 in Tk_MapWindow () from
/home/loic/tmp/bluelagoon/lib/libtk8.5.so
#37 0xb6b927aa in ArrangePacking () from
/home/loic/tmp/bluelagoon/lib/libtk8.5.so
#38 0xb6b1a668 in TclServiceIdle () from
/home/loic/tmp/bluelagoon/lib/libtcl8.5.so
#39 0xb6afd4a7 in Tcl_DoOneEvent () from
/home/loic/tmp/bluelagoon/lib/libtcl8.5.so
#40 0xb6d70d9a in Tkapp_MainLoop (selfptr=0x8892288, args=0x8138c0c) at
/home/loic/tmp/bluelagoon/src/Python-2.5.2/Modules/_tkinter.c:2547
#41 0xb7e4c25a in PyCFunction_Call (func=0x88700cc, arg=0x8138c0c, kw=0x0)
at Objects/methodobject.c:73
#42 0xb7e99ed6 in PyEval_EvalFrameEx (f=0x8ab9e94, throwflag=0) at
Python/ceval.c:3573
#43 0xb7e9b668 in PyEval_EvalCodeEx (co=0x87e0800, globals=0x87d5d74,
locals=0x0, args=0x8ab9a18, argcount=0, kws=0x8ab9a18, kwcount=0,
 defs=0x88563b8, defcount=1, closure=0x0) at Python/ceval.c:2836
#44 0xb7e99bbc in PyEval_EvalFrameEx (f=0x8ab98d4, throwflag=0) at
Python/ceval.c:3669
---Type <return> to continue, or q <return> to quit---
#45 0xb7e9b668 in PyEval_EvalCodeEx (co=0x87d3608, globals=0x87d52d4,
locals=0x0, args=0x877f678, argcount=0, kws=0x877f678, kwcount=0,
 defs=0x0, defcount=0, closure=0x0) at Python/ceval.c:2836
#46 0xb7e99bbc in PyEval_EvalFrameEx (f=0x877f53c, throwflag=0) at
Python/ceval.c:3669
#47 0xb7e9b668 in PyEval_EvalCodeEx (co=0xb7c2e5c0, globals=0xb7c18acc,
locals=0xb7c18acc, args=0x0, argcount=0, kws=0x0, kwcount=0,
 defs=0x0, defcount=0, closure=0x0) at Python/ceval.c:2836
#48 0xb7e9b7c3 in PyEval_EvalCode (co=0xb7c2e5c0, globals=0xb7c18acc,
locals=0xb7c18acc) at Python/ceval.c:494
#49 0xb7ebdf53 in PyRun_InteractiveOneFlags (fp=0xb7d8a440,
filename=0xb7ef36fc "<stdin>", flags=0xbfd05ad8) at Python/pythonrun.c:1273
#50 0xb7ebe18b in PyRun_InteractiveLoopFlags (fp=0xb7d8a440,
filename=0xb7ef36fc "<stdin>", flags=0xbfd05ad8) at Python/pythonrun.c:723
#51 0xb7ebe8d7 in PyRun_AnyFileExFlags (fp=0xb7d8a440, filename=0xb7ef36fc
"<stdin>", closeit=0, flags=0xbfd05ad8)
 at Python/pythonrun.c:692
#52 0xb7ec819f in Py_Main (argc=0, argv=0xbfd05ba4) at Modules/main.c:523
#53 0x080485b2 in main (argc=Cannot access memory at address 0x6
) at ./Modules/python.c:23
The local version of Python use the good version of Tcl/Tk.
 =============
 TESTING Tkinter
 =============
$ wget
http://academic.evergreen.edu/curricular/modelingmotion/ExampleCode/gui/hello2.py
--07:55:32--
http://academic.evergreen.edu/curricular/modelingmotion/ExampleCode/gui/hello2.py
 => `hello2.py.1'
Résolution de academic.evergreen.edu... 192.211.16.13
Connexion vers academic.evergreen.edu|192.211.16.13|:80...connecté.
requête HTTP transmise, en attente de la réponse...200 OK
Longueur: 613 [text/plain]
100%[=================================>] 613 --.--K/s
07:55:33 (80.95 MB/s) - « hello2.py » sauvegardé [613/613]
$ python2.5 hello2.py
=> works fine.
 ======================================
 TESTING MATPLOTLIB'MODULES IMPORTATION
 ======================================
I've seen oin the archive that there could be issue with pycxx and some
version
of gcc, and that trying to import matplotlib submodule could give some
clues :
(cf.
http://www.mail-archive.com/mat...@li.../msg02822.html
)
$ python2.5
Python 2.5.2 (r252:60911, Feb 26 2008, 22:21:12)
[GCC 4.2.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import matplotlib._image
>>> import matplotlib._transforms
>>> import matplotlib.backends._ns_backend_agg
Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
ImportError: No module named _ns_backend_agg
>>> import matplotlib.backends._tkagg
>>> import matplotlib._agg
>>>
>>>
>>> import matplotlib.backends
>>> dir(matplotlib.backends)
['__all__', '__builtins__', '__doc__', '__file__', '__name__', '__path__',
 '_tkagg', 'all_backends', 'backend', 'interactive_bk', 'matplotlib',
 'non_interactive_bk', 'pylab_setup', 'sys', 'time']
Did this give you any information ?
 ==========
 FINALLY...
 ==========
Does anybody has a clue ?
I've tested to install others versions of gcc, tcl/tk or python, but it
didn't solve the problem.
I've tested to make a local installation pycxx-5.4.0, but this didn't work
either.
So, I'm suspecting a prroblem with the fact of making a local installation
of
these programs, but I don't see where.
I've added $INSTALL_DIR/lib to both $LD_LIBRARY_PATH and $LD_RUN_PATH, and
$INSTALL_DIR/bin is the first directory of my $PATH.
-- 
LB
From: Sean H. <se...@sd...> - 2008年02月26日 22:41:36
Okay I've learnt a bit more about this:
http://img229.imageshack.us/img229/6467/scatterplot5st6.png
I need to explicitly make a new figure as well as a new axis, and put
the rc calls before the figure calls, rc changes only seem to take
effect on figures created afterwards. Also I was stupidly using the plot
function (for plotting lines) for a scatter plot, I've now discovered
the scatter function.
Things are pretty much how I want them now, but I still have a couple of
questions:
How do I get rid of the redundant ticks on the top and right edges?
Is there any way to stop some of my text labels from overlapping?
Why is there such a big gap between the plot itself and the axes ticks?
The scatter function seems to do this, but I don't see any option to
control the size of the gap. I wonder if I've done something weird like
create an axes within an axes. I don't mind the gap much, it's just
surprising, and could do with being much smaller to make the figure
easier to read.
Here's my new source code:
rc('xtick.major',size=8)
rc('xtick',direction='out')
rc('ytick.major',size=8)
rc('ytick',direction='out')
fig = figure(facecolor='white' )
axes(frameon=False)
title('Comparison of lower- and upper-bounds per function in week one
and week two')
l =
scatter(functions.lowerboundsweek1,functions.lowerboundsweek2,marker='s',color='g')
u =
scatter(functions.upperboundsweek1,functions.upperboundsweek2,marker='^',color='b')
legend((l,u),('Lower-bounds','Upper-bounds'),'best')
plot([0,1],[0,1],color='#999999',linestyle='--')
xlabel('Week 1')
ylabel('Week 2')
xticks(functions.upperboundsweek1+functions.lowerboundsweek1,'
'*len(functions.upperboundsweek1+functions.lowerboundsweek1))
yticks(functions.upperboundsweek2+functions.lowerboundsweek2,'
'*len(functions.upperboundsweek2+functions.lowerboundsweek2))
for function,x,y in
map(None,functions.shortnames,functions.upperboundsweek1,functions.upperboundsweek2):
 annotate(function,xy=(x,y),size=8,color='b') 
for function,x,y in
map(None,functions.shortnames,functions.lowerboundsweek1,functions.lowerboundsweek2):
 annotate(function,xy=(x,y),size=8,color='g') 
On Tue, 2008年02月26日 at 16:51 +0000, chombee wrote:
> I'm having a couple of problems drawing a basic relational scatter plot.
> (Specifically, it's called a dot-dash-plot in the book I have and is
> described as "framing the bivariate scatter with the marginal distribution
> of each variable.") The idea is that you have a bivariate scatter plot
> and use the two marginal frequency distributions of the data as the two
> axes.
> 
> 1. By setting the x and y tick length and using space characters as the
> tick labels I was able to get ticks only and no labels on the axes as I
> want. But these ticks appear along the top and right edges of the plot,
> as well as the left and bottom. Is there any way to get rid of the top
> and right ticks?
> 
> 2. I'm getting phantom numbers on my axes, the 0.2, 0.4, 0.6 etc. I
> don't know where these are coming from or what they measure (my data
> ranges from 0-7 on both axes, not 0-1).
> 
> 3. I want to label each data point with a string. I'm doing this with
> annotate but the strings sometimes overlap each other. Any idea how to
> avoid this?
> 
> Here's a PNG of my plot as it is:
> 
> http://img137.imageshack.us/img137/4015/scatterplotlk2.png
> 
> And here's the source:
> 
> # datax and datay are equal length lists of floats, the data I want to 
> # plot. labels is another equal length list containing the strings I 
> # want to label the data points with. All three lists are in the same
> # order.
> 
> axes(frameon=False)
> rc('xtick.major',size=8)
> rc('xtick',direction='out')
> xticks(datax,' '*len(datax))
> rc('ytick.major',size=8)
> rc('ytick',direction='out')
> yticks(datay,' '*len(datay))
> plot(datax,datay,'r.')
> plot([0,7],[0,7]) 
> xlabel('Proportion of total number of cards, week 1')
> ylabel('Proportion of total number of cards, week 2')
> title('Frequency of cards per function')
> for label,x,y in map(None,labels,datax,datay):
> annotate(function,xy=(x,y),size=8)
> 
> Thanks!
> 
> 
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Jeff W. <js...@fa...> - 2008年02月26日 18:54:39
Lionel Roubeyrie wrote:
> Hi all,
> I'm sure it's a trivial question, but can't find any valid answer in the 
> basemap examples directory or with google : I have a georeferenced TIFF file 
> in 'lcc' projection, representing a little portion of France, and I need to 
> put it on a map, resets map limits to a closed portion of the map, and put 
> contours on it. I see how to initialise Basemap with the limits of the 
> raster, but not how to "make a zoom" in the map by specifing coordinates.
> Thanks for your help
> 
Lionel: You can use the set_xlim and set_ylim axes methods to manually 
'zoom' the plot. It has to be done after all the other plotting though, 
since all the Basemap methods (contour, imshow etc) will reset the axes 
limits to show the entire map region. 
-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: chombee <ch...@ne...> - 2008年02月26日 16:55:04
I'm having a couple of problems drawing a basic relational scatter plot.
(Specifically, it's called a dot-dash-plot in the book I have and is
described as "framing the bivariate scatter with the marginal distribution
of each variable.") The idea is that you have a bivariate scatter plot
and use the two marginal frequency distributions of the data as the two
axes.
1. By setting the x and y tick length and using space characters as the
tick labels I was able to get ticks only and no labels on the axes as I
want. But these ticks appear along the top and right edges of the plot,
as well as the left and bottom. Is there any way to get rid of the top
and right ticks?
2. I'm getting phantom numbers on my axes, the 0.2, 0.4, 0.6 etc. I
don't know where these are coming from or what they measure (my data
ranges from 0-7 on both axes, not 0-1).
3. I want to label each data point with a string. I'm doing this with
annotate but the strings sometimes overlap each other. Any idea how to
avoid this?
Here's a PNG of my plot as it is:
http://img137.imageshack.us/img137/4015/scatterplotlk2.png
And here's the source:
# datax and datay are equal length lists of floats, the data I want to 
# plot. labels is another equal length list containing the strings I 
# want to label the data points with. All three lists are in the same
# order.
axes(frameon=False)
rc('xtick.major',size=8)
rc('xtick',direction='out')
xticks(datax,' '*len(datax))
rc('ytick.major',size=8)
rc('ytick',direction='out')
yticks(datay,' '*len(datay))
plot(datax,datay,'r.')
plot([0,7],[0,7]) 
xlabel('Proportion of total number of cards, week 1')
ylabel('Proportion of total number of cards, week 2')
title('Frequency of cards per function')
for label,x,y in map(None,labels,datax,datay):
 annotate(function,xy=(x,y),size=8)
Thanks!
From: Mark B. <ma...@gm...> - 2008年02月26日 14:45:25
To me it sounds like the bounding box is miscalculated when the axis are
turned off.
What you could do as a workaround, is add a fill to the figure that has the
exact same size as the axis box. Maybe then, when you turn the axis off it
will keep the same size? May be an ugly workaround, but worth a shot. You
also don't have to set the backgroundcolor of your plot anymore.
Mark
On Tue, Feb 26, 2008 at 3:22 PM, Jochen Voss <li...@se...> wrote:
> Hi Mark,
>
> On Tue, Feb 26, 2008 at 11:30:55AM +0100, Mark Bakker wrote:
> > As a workaround, can you just turn the axis box and ticks off?
> >
> > xticks([])
> > yticks([])
> > setp(ax,'frame_on',False)
> >
> > Or does that give the same problem?
>
> Unfortunately the problem also occurs when I replace the axis("off")
> with the lines suggested by you. The xticks commands work, but the
> setp breaks things again:
>
> with setp (broken output):
>
> voss@burmah [~/project/kalman/survey/fig2] grep -i BoundingBox out.eps
> %%BoundingBox: 1 300 326 417
> %%HiResBoundingBox: 1.923182 300.843797 325.923182 416.043797
>
> without setp (output looks ok but has an extra frame):
>
> voss@burmah [~/project/kalman/survey/fig2] grep -i BoundingBox out.eps
> %%BoundingBox: 143 338 468 454
> %%HiResBoundingBox: 143.999991 338.520012 467.999991 453.720012
>
> Is there anything else I can try?
>
> Many thanks,
> Jochen
> --
> http://seehuhn.de/
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.6 (GNU/Linux)
>
> iD8DBQFHxCC7f+iD8yEbECURAlbHAKCtb0KbmVSQJV3upSGfwp5ytP4J0gCfRKQm
> QvynbyKTxvsKQuAiy5EWyOI=
> =Wx7H
> -----END PGP SIGNATURE-----
>
>
From: Lionel R. <lro...@li...> - 2008年02月26日 14:40:29
Hi all,
I'm sure it's a trivial question, but can't find any valid answer in the 
basemap examples directory or with google : I have a georeferenced TIFF file 
in 'lcc' projection, representing a little portion of France, and I need to 
put it on a map, resets map limits to a closed portion of the map, and put 
contours on it. I see how to initialise Basemap with the limits of the 
raster, but not how to "make a zoom" in the map by specifing coordinates.
Thanks for your help
-- 
Lionel Roubeyrie - lro...@li...
Chargé d'études et de maintenance
LIMAIR - la Surveillance de l'Air en Limousin
http://www.limair.asso.fr
From: Jochen V. <li...@se...> - 2008年02月26日 14:23:06
Hi Mark,
On Tue, Feb 26, 2008 at 11:30:55AM +0100, Mark Bakker wrote:
> As a workaround, can you just turn the axis box and ticks off?
> 
> xticks([])
> yticks([])
> setp(ax,'frame_on',False)
> 
> Or does that give the same problem?
Unfortunately the problem also occurs when I replace the axis("off")
with the lines suggested by you. The xticks commands work, but the
setp breaks things again:
with setp (broken output):
 voss@burmah [~/project/kalman/survey/fig2] grep -i BoundingBox out.eps 
 %%BoundingBox: 1 300 326 417
 %%HiResBoundingBox: 1.923182 300.843797 325.923182 416.043797
without setp (output looks ok but has an extra frame):
 voss@burmah [~/project/kalman/survey/fig2] grep -i BoundingBox out.eps 
 %%BoundingBox: 143 338 468 454
 %%HiResBoundingBox: 143.999991 338.520012 467.999991 453.720012
Is there anything else I can try?
Many thanks,
Jochen
-- 
http://seehuhn.de/
From: Mark B. <ma...@gm...> - 2008年02月26日 10:31:01
As a workaround, can you just turn the axis box and ticks off?
xticks([])
yticks([])
setp(ax,'frame_on',False)
Or does that give the same problem?
From: Auré G. <aur...@ya...> - 2008年02月26日 08:47:21
>Date: 2008年2月22日 08:15:34 -0600
>From: "John Hunter" <jd...@gm...>
>Subject: Re: [Matplotlib-users] What is the proper way to set y tick
 > labels for a histogram ?
>To: " Aur? Gourrier " <aur...@ya...>
>Cc: mat...@li...
>Message-ID:
 > <88e...@ma...>
>Content-Type: text/plain; charset=ISO-8859-1
>
>On Fri, Feb 22, 2008 at 7:52 AM, Aur? Gourrier
><aur...@ya...> wrote:
>
>> Rather trivial... but instead of the plotting the counts n, I'd like to plot
>> the realtive percentage counts, i.e. n/len(x). I can't really use the option
>> normed = 1 which plots n/(len(x)*dbins). I guess the simplest way would be
>> to simply change the yticklabels (by dividing them by len(x)). The thing is
>> that I simply cannot find out how to do this...
>>
>> I tried using the axes.set_yticklabels() but doesn't work. I've also tried
>> to find the child containing the label but couldn't find it (not in Axes,
>> nor in YAxis etc...). I guess it must be a Text instance.
>
>You can set your own custom tick formatter:
>
>import matplotlib.ticker as ticker
>
>N = len(x)
>def fmt_percent(x, pos=None):
> return '%1.2f'%(float(x)/N)
>
>ax.xaxis.set_major_formatter(ticker.FuncFormatter(fmt_percent)). See
>http://matplotlib.sourceforge.net/examples/custom_ticker1.py for a
>complete example.
>
>JDH
Thanks, that's something I had not looked into yet and will definetly be useful for other pbs I had...
Cheers,
Aure
 ______________________________________________________________________________ 
Yahoo! Mail : un mail innovant avec Messenger compatible Windows Live + stockage illimité. http://mail.yahoo.fr 
From: Auré G. <aur...@ya...> - 2008年02月26日 08:43:57
Yep, that's what I did in the end... it also means that a simple argument could be added to the axes.hist() to do such operation, I described this in a previous post (see below, changes are in major cap).
Thanks for the tip,
Aure
 def hist(self, x, bins=10, RELPERCENT = 1, normed=0, bottom=None,
 align='edge', orientation='vertical', width=None,
 log=False, **kwargs):
 """
 if not self._hold: self.cla()
 n, bins = npy.histogram(x, bins, range=None, normed=normed)
 IF NOT NORMED AND RELPERCENT: N = N/FLOAT(LEN(X))
 if width is None: width = 0.9*(bins[1]-bins[0])
 if orientation == 'horizontal':
 patches = self.barh(bins, n, height=width, left=bottom,
 align=align, log=log)
 elif orientation == 'vertical':
 patches = self.bar(bins, n, width=width, bottom=bottom,
 align=align, log=log)
 else:
 raise ValueError, 'invalid orientation: %s' % orientation
 for p in patches:
 p.update(kwargs)
 return n, bins, cbook.silent_list('Patch', patches)
----- Message d'origine ----
De : Bernhard Voigt <ber...@gm...>
À : Auré Gourrier <aur...@ya...>
Cc : mat...@li...
Envoyé le : Dimanche, 24 Février 2008, 19h10mn 47s
Objet : Re: [Matplotlib-users] plot a histogram of relative percentage of data
Hi!
You could also use the bar method and do the histogram with numpy:
import numpy as n
import pylab as p
foo = n.random.normal(size=100)
p.hist(foo, 20)
p.twinx()
counts, bins = n.histogram(foo, 20)
counts = counts.astype(float)/len(foo)
width = (bins[1]-bins[0]) * .9
p.bar(bins ,counts, width=width, fc='r')
Cheers! Bernhard
On Fri, Feb 22, 2008 at 4:08 PM, Auré Gourrier <aur...@ya...> wrote:
Hi all,
In my latest post, I wanted to use the mpl.hist() function in a different way, i.e.:
x = datalist
bins= 100
hist(x,bins,normed=0) #returns a tupple (n,bins,patches)
Instead of ploting the number of counts n, I wanted to plot the relative percentage of counts, i.e. n/len(x). I can't really use the option normed=1 which returns n/(len(x)*dbin). In the axes.py module, this would simply mean adding an argument e.g. relpercent = 1. I added the code line to show how this could be done (in major cap). If this is useful, how could it be modified in the distribution ?
 def hist(self, x, bins=10, RELPERCENT = 1, normed=0, bottom=None,
 align='edge', orientation='vertical', width=None,
 log=False, **kwargs):
 """
 if not self._hold: self.cla()
 n, bins = npy.histogram(x, bins, range=None, normed=normed)
 IF NOT NORMED AND RELPERCENT: N = N/FLOAT(LEN(X))
 if width is None: width = 0.9*(bins[1]-bins[0])
 if orientation == 'horizontal':
 patches = self.barh(bins, n, height=width, left=bottom,
 align=align, log=log)
 elif orientation == 'vertical':
 patches = self.bar(bins, n, width=width, bottom=bottom,
 align=align, log=log)
 else:
 raise ValueError, 'invalid orientation: %s' % orientation
 for p in patches:
 p.update(kwargs)
 return n, bins, cbook.silent_list('Patch', patches)
 Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail 
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Matplotlib-users mailing list
Mat...@li...
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
 ______________________________________________________________________________ 
Yahoo! Mail : un mail innovant avec Messenger compatible Windows Live + stockage illimité. http://mail.yahoo.fr 
From: Michaël D. <mic...@la...> - 2008年02月26日 08:23:08
Hi list,
I have a set of data with 3 "columns" :
x = x coordinate of the point
y = y coordinate
z = temperature
I can't see how to set a different color for each point function of 
temperature value.
I have tried, which draw a colorfull beautiful "map", the color varying 
with the row rank of x (not what I want)
**********
 sqla="SELECT x, y, temperature FROM import_parcelle a WHERE 
dat_loc='" + date_traite + "' AND code_uc='" + code_uc + "' ORDER BY 
a.dateheure;"
 resa=db.query(sqla)
 data=resa.dictresult()
 x= [float(a["x"]) for a in data] # --> extraction de la colonne x
 y= [float(a["y"]) for a in data] # --> extraction de la colonne y
 z= [float(a["temperature"]) for a in data] # --> extraction de la 
colonne temperature
 scatter(x, y, c=arange(len(x)), cmap=cm.spring)
 title("Carte des temperatures(L/min)")
 xlim(min(x)-10,max(x)+10)
 ylim(min(y)-10,max(y)+10)
**********
What is the good way to do what I reach for ?
I have much trouble to know how to define the c parameter of scatter. I 
saw the "arrange" thing somewhere in internet, but don't understand what 
it is for.
Thanks in advance for your help.
Michael
From: Jochen V. <li...@se...> - 2008年02月25日 21:53:58
Hi,
I have a strange (to me) problem with matplotlib version 0.91.2,
installed from source on a Debian Linux system.
I try to generate a plot which combines bitmap data (using "pcolor")
and some lines (using "plot") as in the appended script. I switch off
the coordinate axes using the command axis("off") and I try to set the
displayed coordinate range using the command
 axis([x0-p, x1+p, y0-p, y1+p])
near the end of the script.
Problem: the output of this script, i.e. the file "out.eps" is
shifted. To me it seems that the PostScript bounding box is wrong.
Some things I noticed:
1) It seems that the pixel data from the pcolor command is centred in
the boundign box. If I plot the pcolor output at different locations,
the bounding box changes. This seems wrong to me, because I expect
the bounding box to be determined by the above axis command.
2) If I comment out the axis("off") command, the output is no longer
shifted and looks perfect, except that it now has the unwanted
coordinate axes.
3) If I output an .png file, using the Agg backend, the problem does
not appear. This does not help, since I need an .eps file.
My questions: What am I doing wrong? How do I get an unshifted .eps
file without coordinate axes? Any help would be very welcome.
Many thanks in advance,
Jochen
== script starts next line ===========================================
#! /usr/bin/env python
import matplotlib
matplotlib.use("PS")
from pylab import *
def create_hist():
 X = array([-2.3, -2.0, -1.7 ])
 Y = array([-0.3, -0.0, 0.3 ])
 hist = array([[ 0.2, 0.4 ], [ 0.6, 0.8 ]])
 return X, Y, hist
def generate_figure(fname, X, Y, hist, stamp=None):
 width = 4.5
 height = 1.6
 margin = 0.05
 padding = 0.05
 x0 = -3.3
 x1 = 4.0
 q = (x1-x0)/(width - 2*margin - 2*padding)
 y0 = -0.3
 y1 = y0 + (height - 2*margin - 2*padding)*q
 # create an appropriately sized figure
 rc('text', usetex=True)
 rc('font', family="serif", serif="Times", size=12.0)
 rc('xtick', labelsize=12)
 rc('ytick', labelsize=12)
 rc('figure.subplot', left=margin/width)
 rc('figure.subplot', right=(width-margin)/width)
 rc('figure.subplot', bottom=margin/height)
 rc('figure.subplot', top=(height-margin)/height)
 fig = figure(figsize=(width, height))
 ax = axes([margin/width, margin/height,
 (width-2*margin)/width, (height-2*margin)/height])
 p = q*padding
 # plot the density data
 mycmdata = {
 'red': ((0., 1.0, 1.0), (0.01, 0.95, 0.95), (1.0, 0.0, 0.0)),
 'green': ((0., 1.0, 1.0), (0.01, 0.95, 0.95), (1.0, 0.0, 0.0)),
 'blue': ((0., 1.0, 1.0), (0.01, 0.95, 0.95), (1.0, 0.0, 0.0)),
 }
 mycm = matplotlib.colors.LinearSegmentedColormap('mycm', mycmdata)
 pcolor(X, Y, hist, cmap=mycm, shading='flat')
 # plot the corner
 plot([x0, x0, x1], [y1, y0, y0], "k-")
 plot([x0+0.6, x0+0.6, x1], [y1, y0+0.6, y0+0.6], "k-")
 # place the stamp
 if stamp is not None:
 text(x1-p, y1-p, stamp, va='top', ha='right')
 # save the result
 axis([x0-p, x1+p, y0-p, y1+p])
 axis("off")
 savefig(fname, facecolor="yellow")
X, Y, hist = create_hist()
generate_figure("out.eps", X, Y, hist, "$t=1$")
From: Bernhard V. <ber...@gm...> - 2008年02月25日 18:50:11
Hi Eric!
Are you sure you want a colorbar with lines and not a legend?
Well, I've got a couple of lines (~50) and thus the legend would become
confusing.
I wanted to have lines in the colorbar because I think it's more adequate to
have lines in the bar when there are lines in the plot.
A colorbar with lines only, matching a LineCollection, can be done with
> the facilities in mpl's colorbar.py module; you might take a look at
> the code in that module to see how it is being done in the line contour
> case. Note that ColorbarBase has a method, add_lines, for this. I'm
> sorry I don't have time to be more specific now, though.
Thanks for the hint! I was quite simple, I made a call to
pylab.colorbar(filled=False)
which gave me an empty colorbar. Then I add lines to this instance:
colorbar.ColorbarBase.add_lines(cbar, myrange, linecl.get_colors(),
linecl.get_linewidth())
Thanks! Bernhard
>
> Eric
>
> Bernhard Voigt wrote:
> > Dear all!
> >
> > I'm folowing the line_collection2.py example to create a LineCollection
> > plot with a colorbar.
> > How can I force the colorbar to show distinct lines like it does in
> > contour plots for a LineCollection plot?
> >
> > Thanks! Bernhard
>
From: BL <bra...@gm...> - 2008年02月25日 18:03:08
 Hi,
I've made a local installation of python2.5, numpy 1.0.4 and matplotlib
0.91.2.
I didn't see any pb during compilation, but when I try to show a figure, I
received SIGSEGV.
You will find attached to this mail the log of my installation, and a
backtrace of a segfault in gdb, I don't know if this helps.
Have you got any glue ?
-- 
LB
Thanks for the reply,
It was not a problem with the specific python I used.
In fact I have a problem because the Tcl/Tk libraries were in /usr/share/lib
whereas their include files were in /usr/include. In my case, I used the
debian package tkx8.3-dev which does not follow that idiom ( I don't know
why..)
As far as I understand, matplotlib asks Python for the path of its Tk
library, and guess the path of the include directory from this path by
adding '../../include/tk' + tk_ver.
I solved my problem by removing this old version of Tk and building a new
one.
But I still think matplotlib should look in the directories given at the top
of setupext.py (or in the setup.cfg file, which would be even better, I
don't like the fact of having to modify directly setupext.py).
Regards,
-- 
LB
From: Shane L. <sh...@ve...> - 2008年02月25日 17:26:17
Hi,
I'm new here so sorry in advance if this has already been addressed
and I missed it in my archive search...
I think there is a significant bug in plot_wireframe in matplotlib
where it incorrectly displays the Z axis values. The code below
demonstrates the problem:
import scipy
import pylab as p
import matplotlib.axes3d as p3
from numpy import *
"""
# If you do a wire frame of the following, the graph is correct:
Z = scipy.array(
[[ 0.52, 0.00020],
 [ 0.45, 0.00018],
 [ 0.34, 0.00016]] )
"""
# but if you put negative signs in:
Z = scipy.array(
[[ -0.52, -0.00020],
 [ -0.45, -0.00018],
 [ -0.34, -0.00016]] )
"""
 the graph displays:
[[ -0.62, -0.10020 ],
 [ -0.55, -0.10018 ],
 [ -0.44, -0.10016 ]]
"""
X, Y = meshgrid(arange(0, 3, 1.0), arange(0, 4, 1.0))
fig = p.figure()
ax = p3.Axes3D(fig)
ax.plot_wireframe(X, Y, Z)
ax.set_xlabel('X')
ax.set_ylabel('Y')
ax.set_zlabel('Z')
p.show()
I'm running Ubuntu 7.10 x64 with python 2.5.1-1ubuntu2 and
python-scipy 0.5.2-9ubuntu4 both installed from the .deb files.
I sent the above code to somebody with a 32bit Linux system
and they had the same problem.
Any help appreciated!
Cheers
Shane
From: Michael D. <md...@st...> - 2008年02月25日 16:40:05
You may want to confirm that the python use use to build matplotlib is 
the intended one (in your home). As a first try, matplotlib's setup 
will import Tkinter and grab the include paths from there.
By this I mean when you type:
 python setup.py install
that "python" is the specific python use want to use.
Also check that Tkinter imports without errors in your custom Python.
Cheers,
Mike
BL wrote:
> Hi,
> 
> I've got difficulties to make a local installation of matplotlib.
> I think it's due to my nonstandard installation of python and tk, which 
> both are in my home.
> 
> I've seen on the website that , for non standard installation, I should 
> complete the basedir dictionary defined in the setupext.py script.
> 
> But for the Tcl/Tk header files, this does not seems to work. Whatever I 
> put in this dictionary, the module.include_dirs corresponding to Tk 
> (line 825 of setupext.py) is always equal to ['/usr/share/include', 
> '/usr/share/include'].
> 
> Did I miss something obvious ?
> 
> I'm on a linux2 platform and I''m trying make a local installation of 
> python2.5 + matplotlib 0.91.2 in my home.
> 
> Regards,
> -- 
> LB
> 
> 
> ------------------------------------------------------------------------
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
From: Troels K. J. <tkj...@gm...> - 2008年02月25日 13:55:59
Hi Guys
Is there an eays way to plot a number vs a label from a file?
Here is an example
I have a datafile like this:
#Aa Bb nA nB Surf Bulk segEnergy
Fe Cr 19 1 -909.065612 -909.060586 -0.100520
Fe Ni 19 1 -855.708731 -855.700865 -0.157320
Fe Mo 19 1 -810.257339 -810.252167 -0.103440
I want to plot the last row vs the second row.
Now i have to do:
y,dummy = load('data.dat',usecols=(6,6),unpack=True)
xticks=xticks(arange(3),('Cr','Ni','Mo'))
plot(y)
Is there an easy way to do this?
And why does usecols=(6) not work?
-- 
Med Venlig Hilsen / Best Regards
Troels Kofoed Jacobsen
From: Eric F. <ef...@ha...> - 2008年02月24日 19:20:10
Bernhard,
Are you sure you want a colorbar with lines and not a legend?
A colorbar with lines only, matching a LineCollection, can be done with 
 the facilities in mpl's colorbar.py module; you might take a look at 
the code in that module to see how it is being done in the line contour 
case. Note that ColorbarBase has a method, add_lines, for this. I'm 
sorry I don't have time to be more specific now, though.
Eric
Bernhard Voigt wrote:
> Dear all!
> 
> I'm folowing the line_collection2.py example to create a LineCollection 
> plot with a colorbar.
> How can I force the colorbar to show distinct lines like it does in 
> contour plots for a LineCollection plot?
> 
> Thanks! Bernhard
From: Bernhard V. <ber...@gm...> - 2008年02月24日 18:53:53
Dear all!
I'm folowing the line_collection2.py example to create a LineCollection plot
with a colorbar.
How can I force the colorbar to show distinct lines like it does in contour
plots for a LineCollection plot?
Thanks! Bernhard
From: Bernhard V. <ber...@gm...> - 2008年02月24日 18:10:52
Hi!
You could also use the bar method and do the histogram with numpy:
import numpy as n
import pylab as p
foo = n.random.normal(size=100)
p.hist(foo, 20)
p.twinx()
counts, bins = n.histogram(foo, 20)
counts = counts.astype(float)/len(foo)
width = (bins[1]-bins[0]) * .9
p.bar(bins ,counts, width=width, fc='r')
Cheers! Bernhard
On Fri, Feb 22, 2008 at 4:08 PM, Auré Gourrier <aur...@ya...>
wrote:
> Hi all,
>
> In my latest post, I wanted to use the mpl.hist() function in a different
> way, i.e.:
>
> x = datalist
> bins= 100
> hist(x,bins,normed=0) #returns a tupple (n,bins,patches)
>
> Instead of ploting the number of counts n, I wanted to plot the relative
> percentage of counts, i.e. n/len(x). I can't really use the option
> normed=1 which returns n/(len(x)*dbin). In the axes.py module, this would
> simply mean adding an argument e.g. relpercent = 1. I added the code line
> to show how this could be done (in major cap). If this is useful, how could
> it be modified in the distribution ?
>
>
> def hist(self, x, bins=10, RELPERCENT = 1, normed=0, bottom=None,
> align='edge', orientation='vertical', width=None,
> log=False, **kwargs):
> """
>
> if not self._hold: self.cla()
> n, bins = npy.histogram(x, bins, range=None, normed=normed)
> IF NOT NORMED AND RELPERCENT: N = N/FLOAT(LEN(X))
> if width is None: width = 0.9*(bins[1]-bins[0])
> if orientation == 'horizontal':
> patches = self.barh(bins, n, height=width, left=bottom,
> align=align, log=log)
> elif orientation == 'vertical':
> patches = self.bar(bins, n, width=width, bottom=bottom,
> align=align, log=log)
> else:
> raise ValueError, 'invalid orientation: %s' % orientation
> for p in patches:
> p.update(kwargs)
> return n, bins, cbook.silent_list('Patch', patches)
>
>
> ------------------------------
> Ne gardez plus qu'une seule adresse mail ! Copiez vos mails<http://fr.rd.yahoo.com/mail/mail_taglines/trueswitch/SIG=11gshn0bu/**http%3A%2F%2Fwww.trueswitch.com%2Fyahoo-fr%2F>vers Yahoo! Mail
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
From: Phil A. <pha...@gm...> - 2008年02月23日 19:21:07
I'm having two (presumably) unrelated problems with contourf
1) One of my datasets seems to trigger a bug:
Specifically when I run the appended script
(http://clouds.eos.ubc.ca/~phil/matplotlib_error/arrayplot.py)
using the pickled array:
(http://clouds.eos.ubc.ca/~phil/matplotlib_error/array.pic)
I get:
http://clouds.eos.ubc.ca/~phil/matplotlib_error/surfaceOnTop.png
but if I try to flip the pressure axis by uncommenting:
axes1.set_ylim([1000,250])
the rightside-up plot is corrupted
http://clouds.eos.ubc.ca/~phil/matplotlib_error/surfaceOnBottom.png
2) It looks like the alpha=0.25 setting for the normalized set_under/over
colormap works for the colorbar (the little triangles are transparent)
but not for the actually filled contours (the under values are
saturated black/salmon)
All of this is with the current matplotlib svn snapshot (revision 4986).
Both the top and bottom runs give the same --verbose-helpful output:
~/public_html/matplotlib_error phil@owl% python arrayplot.py 
--verbose-helpful
$HOME=/home/phil
CONFIGDIR=/home/phil/.matplotlib
matplotlib data path 
/home/phil/usr251_Centos/lib/python2.5/site-packages/matplotlib/mpl-data
loaded rc file /home/phil/.matplotlib/matplotlibrc
matplotlib version 0.98pre
verbose.level helpful
interactive is False
units is False
platform is linux2
numerix numpy 1.0.5.dev4731
Using fontManager instance from /home/phil/.matplotlib/fontManager.cache
backend Agg version v2.2
Warning: invalid value encountered in reduce
Warning: invalid value encountered in reduce
thanks in advance for any suggestions -- Phil
#--------------------
import numpy as N
import matplotlib as mpl
import pickle
mpl.use('Agg')
from pylab import figure, show, close,setp,savefig
fig1=figure(1)
fig1.clf()
axloc = [.1, .1, .67, .8]
colorbarloc = [.82, .1, .025, .8]
axes1 = fig1.add_axes(axloc)
colorbaraxes = fig1.add_axes(colorbarloc)
vmin, vmax = (-40, 20)
norm = mpl.colors.normalize(vmin = vmin, vmax = vmax)
cmap = mpl.cm.jet
cmap.set_over('black', 0.25)
cmap.set_under('salmon', 0.25)
picFile=open('array.pic','r')
plotArray=pickle.load(picFile)
picFile.close()
timeMarks=N.arange(0,9)
presslevs=N.arange(1000,200,-10)
contplot = 
axes1.contourf(timeMarks,presslevs,plotArray,N.linspace(vmin,vmax,7),
 norm=norm,
 extend='both',
 cmap=cmap)
#axes1.set_ylim([1000,250])
fig1.colorbar(contplot,colorbaraxes)
labelHandle=colorbaraxes.set_ylabel('temperature (deg C)')
setp(labelHandle,'rotation',-90,'ha','left')
axes1.set_xticks(timeMarks[[0,4,8]])
axes1.set_ylabel('pressure (hPa)')
axes1.set_xlabel('Date')
axes1.set_title('LXK balloon sondes')
#savefig('surfaceOnBottom')
savefig('surfaceOnTop')
 
 
 
 
 
 
 
 
 
From: BL <bra...@gm...> - 2008年02月23日 17:19:03
 Hi,
I've got difficulties to make a local installation of matplotlib.
I think it's due to my nonstandard installation of python and tk, which both
are in my home.
I've seen on the website that , for non standard installation, I should
complete the basedir dictionary defined in the setupext.py script.
But for the Tcl/Tk header files, this does not seems to work. Whatever I put
in this dictionary, the module.include_dirs corresponding to Tk (line 825 of
setupext.py) is always equal to ['/usr/share/include',
'/usr/share/include'].
Did I miss something obvious ?
I'm on a linux2 platform and I''m trying make a local installation of
python2.5 + matplotlib 0.91.2 in my home.
Regards,
-- 
LB
3 messages has been excluded from this view by a project administrator.

Showing results of 356

<< < 1 2 3 4 5 6 .. 15 > >> (Page 4 of 15)
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /