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
(12) |
3
(3) |
4
(13) |
5
(13) |
6
(2) |
|
7
(5) |
8
(17) |
9
(9) |
10
(10) |
11
(16) |
12
(8) |
13
(10) |
|
14
(1) |
15
(5) |
16
(5) |
17
(7) |
18
(13) |
19
(9) |
20
|
|
21
|
22
(2) |
23
(3) |
24
(5) |
25
(5) |
26
(14) |
27
(1) |
|
28
(2) |
29
(18) |
30
(5) |
31
(22) |
|
|
|
|
From: yadin B. R. <con...@ya...> - 2007-10-05 08:55:00
|
I i have tree lists of values=0Alist x of 100... values=0Alist y of 100.. v=
alues=0Alist mag of 100.. values=0Alist x and y are coordiantes of points =
=0Aand list Mag is magnitude of something at that point=0A=0Ahow can i plot=
this quantities using pcolor=0A=0Afrom __future__ import division=0Afrom m=
atplotlib.patches import Patch=0Afrom pylab import *=0A=0Adef func3(x,y):=
=0A return (1- x/2 + x**5 + y**3)*exp(-x**2-y**2)=0A=0A=0A# make these s=
maller to increase the resolution=0Adx, dy =3D 0.5, 0.5=0A=0AX =3D arange(-=
3.0, 3.0001, dx)=0A=0AY =3D arange(-3.0, 3.0001, dy)=0A=0AMag=3D X**2+Y**2=
=0A=0Apcolor(X, Y, Mag, shading=3D'flat')=0Acolorbar()=0Aaxis([-3,3,-3,3])=
=0Asavefig('pcolor_demo')=0Ashow()=0A=0A=0A=0A=0A ____________________=
________________________________________________________________=0A=A1S=E9 =
un mejor besador!=0AComparte todo lo que sabes sobre besos. =
=0Ahttp://telemundo.yahoo.com/promos/mejorbesador.html |
|
From: yadin B. R. <con...@ya...> - 2007-10-05 08:46:42
|
hi i have been trying to use pcolor and/or contour to make a contor map
or intensity map
i want to do an intensity or contour map of an electric field
i have an array (or list) of points [x,y] and for each point i have the respective value of the electric field (in another list)
i have tried the examples in matplotlib but they are different because they use meshgrid
and from the points calculated in the mesh get values and plot...
in my case i want to plot directly...each poin (x,z) its magnitude(E_fiel_Mag)
i do not think i need to use meshgrid any more how can i do my plot?
below is my code...pls help me!!!
#!/usr/bin/env python
# This example demonstrates how to use a constraint polygon in
# Delaunay triangulation.
from scipy import*
from pylab import*
read_file= open ('W:/Serio/necfile.out','r')
L =read_file.readlines()
fieldlist =[]
f = 0
for line in L:
f=f+1
if 'NEAR ELECTRIC FIELDS'in line:
rpoints = 3
phipoints = 3
tetapoints = 1
for line in range (f+3,f+4+rpoints*phipoints*tetapoints):
fieldlist.append(L[line])
Ex = [];Ey = [];Ez = []
x1 =[];y1=[];z1=[]
Exphase=[]; Eyphase=[]; Ezphase=[]
for i in range(len(fieldlist)-1):
splitlines= fieldlist[i].split()
x1.append(float(splitlines[0])) #here we pick up the x,y,x coordinates of the points
y1.append(float(splitlines[1])) #where the manitude has been calculated
z1.append(float(splitlines[2]))
Ex.append(float(splitlines[3])) #pick up the e-filed magnitudes
Ey.append(float(splitlines[5])) #u append as floats instead os string for later calculations
Ez.append(float(splitlines[7]))
Exphase.append(float(splitlines[4])) # pick up the phases just in case they are needed
Eyphase.append(float(splitlines[6]))
Ezphase.append(float(splitlines[8]))
read_file.close()
# i want to see if i can calculate the magnitude of the electric field
E_field_Mag = []
for i in range(len(Ex)):
E_Magnitude = sqrt((Ex[i])**2 + (Ey[i])**2+(Ez[i])**2)
E_field_Mag.append(E_Magnitude)
#E_field_Mag = array(E_field_Mag)
#y values are zero
#X,Z = meshgrid(x1, z1)
pcolor(x1,y1,E_field_Mag)
----- Mensaje original ----
De: "mat...@li..." <mat...@li...>
Para: mat...@li...
Enviado: domingo, 30
de septiembre, 2007 12:53:11
Asunto: Matplotlib-users Digest, Vol 16, Issue 32
Send Matplotlib-users mailing list submissions to
mat...@li...
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
or, via email, send a message with subject or body 'help' to
mat...@li...
You can reach the person managing the list at
mat...@li...
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Matplotlib-users digest..."
Today's Topics:
1. Re: NameError: global name '__loader__' is not
defined
(Eric Firing)
2. Re: plot cdf (Alan G Isaac)
3. Re: edgecolor with usetex=True, usedistiller='pdf' (Darren Dale)
4. Re: Problem with tick labels in scripts (John Hunter)
5. Using special characters (David Loyall)
6. Re: matplotlib - representation of nan values in 2D
(Dirk Zickermann)
----------------------------------------------------------------------
Message: 1
Date: Thu, 27 Sep 2007 14:46:13 -1000
From: Eric Firing <ef...@ha...>
Subject: Re: [Matplotlib-users] NameError: global name '__loader__' is
not defined
To: Hal Huntley <ha...@so...>
Cc: mat...@li...
Message-ID: <46F...@ha...>
Content-Type:
text/plain; charset=ISO-8859-1; format=flowed
Hal Huntley wrote:
> Thanks to Eric Firing and Christopher Barker for input on trying to
> resolve the problem. Christopher said:
> %%%
> You might try just:
>
> easy_install numpy
>
> easy_install matplotlib.
> %%%
>
>
> I did that and now the problem moved and I get:
> ===
>>>> from pylab import *
> Traceback (most recent call last):
> File "<stdin>", line 1, in ?
> File
> "/usr/lib/python2.4/site-packages/matplotlib-0.90.1-py2.4-linux-i686.egg/pylab.py", line 1, in ?
> from matplotlib.pylab import *
> File
> "/usr/lib/python2.4/site-packages/matplotlib-0.90.1-py2.4-linux-i686.egg/matplotlib/pylab.py", line 222, in ?
>
new_figure_manager, draw_if_interactive, show = pylab_setup()
> File
> "/usr/lib/python2.4/site-packages/matplotlib-0.90.1-py2.4-linux-i686.egg/matplotlib/backends/__init__.py", line 24, in pylab_setup
> globals(),locals(),[backend_name])
> File
> "/usr/lib/python2.4/site-packages/matplotlib-0.90.1-py2.4-linux-i686.egg/matplotlib/backends/backend_gtkagg.py", line 10, in ?
> from matplotlib.backends.backend_gtk import gtk, FigureManagerGTK,
> FigureCanvasGTK,\
> File
> "/usr/lib/python2.4/site-packages/matplotlib-0.90.1-py2.4-linux-i686.egg/matplotlib/backends/backend_gtk.py", line 21, in ?
> from matplotlib.backends.backend_gdk import RendererGDK, FigureCanvasGDK
> File
>
"/usr/lib/python2.4/site-packages/matplotlib-0.90.1-py2.4-linux-i686.egg/matplotlib/backends/backend_gdk.py", line 35, in ?
> from matplotlib.backends._ns_backend_gdk import pixbuf_get_pixels_array
> ImportError: No module named _ns_backend_gdkd4
> ===
Is it a rotten egg?
>
> Googling around has indicated that the X11 stuff wasn't available when the
> numpy and matplotlib were made. The gtk files and "-devel" seem to be there
> when I do an "rpm -qa". I went and got a new numpy from source and did
> "python setup.py install". It is interesting that when I get in to python
> now, I can do:
>
>>>> import gtk
>>>> import numpy
>>>> import matplotlib
>
> and they all just return the prompt, indicating, I thought, that the
> programs were installed ok.
>
> Here is the naive question -> Is there something wrong, then with a
> "from pylab import *"? The user is trying to do that.
No, that should work fine. I don't know how the egg-based
matplotlib/pylab should work with the installed-from-source numpy,
though. If the versions are compatible, then I expect it would work.
You gave a traceback resulting from "from pylab import *" after
installing the two eggs, correct? If so, what was the result after you
installed numpy from source? I would expect no difference, because the
problem reported in the traceback is a missing matplotlib module, not a
missing numpy module.
Or did you mean that you installed matplotlib from source? That would
make more sense, and certainly should work if all the right header files
and libraries are present.
If you installed matplotlib from
source, what do you get from
ls /usr/lib/python2.4/site-packages/matplotlib/backends/*.so
Another diagnostic would be to delete the build directory from the
matplotlib source tree (assuming you are now building matplotlib from
source), and save the output from the "python setup.py build" command.
This should make it clear whether the necessary headers really were found.
Eric
------------------------------
Message: 2
Date: Fri, 28 Sep 2007 00:18:13 -0400
From: Alan G Isaac <ai...@am...>
Subject: Re: [Matplotlib-users] plot cdf
To: mat...@li...
Message-ID: <Mah...@am...>
Content-Type: TEXT/PLAIN; CHARSET=UTF-8
After thinking it over, I did not go for
Robert or David's cool numpy tricks, but
I'll append a simple object in case someone
else wants to do more.
Cheers,
Alan
Isaac
class EmpiricalCDF(object):
'''Empirical cdf.
First point will be (xmin,0).
Last point will be (xmax,1).
'''
def __init__(self, data, sortdata=True):
if sortdata:
data = N.sort(data)
self.data = data
self.nobs = len(data)
def gen_xp(self):
data, nobs = self.data, self.nobs
prob = N.linspace(0, 1, nobs+1)
xsteps = ( data[(idx)//2] for idx in xrange(2*nobs)
)
psteps = ( prob[(idx+1)//2] for idx in xrange(2*nobs) )
return xsteps, psteps
def get_steps(self):
'''Return: 2-tuple of arrays,
the data values and corresponding cumulative
probabilities.
'''
xsteps, psteps = self.gen_xp()
return N.fromiter(xsteps,'f'), N.fromiter(psteps,'f')
------------------------------
Message: 3
Date: Fri, 28 Sep 2007 08:23:17 -0400
From: Darren Dale <dd...@co...>
Subject: Re: [Matplotlib-users] edgecolor with
usetex=True,
usedistiller='pdf'
To: "John Hunter" <jd...@gm...>
Cc: matplotlib-users <mat...@li...>, Eric
Firing <ef...@ha...>
Message-ID: <200...@co...>
Content-Type: text/plain; charset="iso-8859-1"
On Friday 28 September 2007 07:36:23 am John Hunter wrote:
> On 9/27/07, Darren Dale <dd...@co...> wrote:
> > Hi Eric, John,
> >
> > Have either of you been following this thread?
>
> I am now :-)
>
> As Eric suggests, None is overloaded vis-a-vis color handling, because
> for mpl properties it generally means do the default as defined by rc.
> For colors people often want to use None for "no color" which is why
> we added support for the string "None". Does
this work in your use
> case Tom?
The above exchange was off-list, we're back on now. I think that would be what
Tom is looking for, but it doesnt work:
In [1]: plot([1,2])
Out[1]: [<matplotlib.lines.Line2D instance at 0x710cb0>]
In [2]: savefig('dsd.png', facecolor='None', edgecolor='None')
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
/home/darren/<ipython console> in <module>()
/usr/lib64/python2.5/site-packages/matplotlib/pyplot.py in savefig(*args,
**kwargs)
272 def savefig(*args, **kwargs):
273 fig = gcf()
-->
274 return fig.savefig(*args, **kwargs)
275 if Figure.savefig.__doc__ is not None:
276 savefig.__doc__ = dedent(Figure.savefig.__doc__)
/usr/lib64/python2.5/site-packages/matplotlib/figure.py in savefig(self,
*args, **kwargs)
768 kwargs[key] = rcParams['savefig.%s'%key]
769
--> 770 self.canvas.print_figure(*args, **kwargs)
771
772 def colorbar(self, mappable, cax=None, **kw):
/usr/lib64/python2.5/site-packages/matplotlib/backends/backend_qt4agg.py in
print_figure(self, *args,
**kwargs)
153 self.update(l, self.renderer.height-t, w, h)
154
155 def print_figure(self, *args, **kwargs):
--> 156 FigureCanvasAgg.print_figure(self, *args, **kwargs)
157 self.draw()
/usr/lib64/python2.5/site-packages/matplotlib/backend_bases.py in
print_figure(self, filename, dpi, facecolor, edgecolor, orientation, format,
**kwargs)
1194 edgecolor=edgecolor,
1195 orientation=orientation,
->
1196 **kwargs)
1197 finally:
1198 self.figure.dpi.set(origDPI)
/usr/lib64/python2.5/site-packages/matplotlib/backends/backend_agg.py in
print_png(self, filename, *args, **kwargs)
415
416 def print_png(self, filename, *args, **kwargs):
--> 417 self.draw()
418 self.get_renderer()._renderer.write_png(str(filename))
419
/usr/lib64/python2.5/site-packages/matplotlib/backends/backend_qt4agg.py in
draw(self)
140 if DEBUG: print "FigureCanvasQtAgg.draw", self
141 self.replot = True
--> 142 FigureCanvasAgg.draw(self)
143 self.update()
144
/usr/lib64/python2.5/site-packages/matplotlib/backends/backend_agg.py in
draw(self)
377
378 self.renderer = self.get_renderer()
--> 379 self.figure.draw(self.renderer)
380
381 def get_renderer(self):
/usr/lib64/python2.5/site-packages/matplotlib/figure.py in
draw(self,
renderer)
586 self.transFigure.freeze() # eval the lazy objects
587
--> 588 if self.frameon: self.figurePatch.draw(renderer)
589
590 for p in self.patches: p.draw(renderer)
/usr/lib64/python2.5/site-packages/matplotlib/patches.py in draw(self,
renderer)
198 #renderer.open_group('patch')
199 gc = renderer.new_gc()
--> 200 gc.set_foreground(self._edgecolor)
201
gc.set_linewidth(self._linewidth)
202 gc.set_alpha(self._alpha)
/usr/lib64/python2.5/site-packages/matplotlib/backend_bases.py in
set_foreground(self, fg, isRGB)
617 self._rgb = fg
618 else:
--> 619 self._rgb = colors.colorConverter.to_rgb(fg)
620
621 def set_graylevel(self, frac):
/usr/lib64/python2.5/site-packages/matplotlib/colors.py in to_rgb(self, arg)
277
278 except (KeyError, ValueError, TypeError), exc:
-->
279 raise ValueError('to_rgb: Invalid rgb arg "%s"\n%s' %
(str(arg), exc))
280 # Error messages could be improved by handling TypeError
281 # separately; but this should be rare and not too hard
ValueError: to_rgb: Invalid rgb arg "None"
invalid literal for float(): None
------------------------------
Message: 4
Date: Fri, 28 Sep 2007 07:41:35 -0500
From: "John Hunter" <jd...@gm...>
Subject: Re: [Matplotlib-users] Problem with tick labels in scripts
To: "Charles Seaton" <cs...@st...>
Cc:
mat...@li...
Message-ID:
<88e...@ma...>
Content-Type: text/plain; charset=ISO-8859-1
On 9/27/07, Charles Seaton <cs...@st...> wrote:
> I am having the same problem as Eugen, and the suggested solution of using
> a.xaxis.get_major_locator().refresh()
> to force the creation of the full set of ticklabels doesn't seem to work for
> me.
matplotlib creates a prototypical tick (the prototick) and then
creates new ones on as as needed basis, copying properties from the
prototick. Of course, position is one of the properties that cannot
be copied, which is why you are having trouble in your example.
Fortunately, there is an easy solution.
Call ax.xaxis.get_major_ticks() and access the label attribute:
for tick in ax.xaxis.get_major_ticks():
label = tick.label1
Axis.get_major_ticks will force a call to the locator and update the
tick list. The Axes methods like get_xticklabels are just working on
the existing tick list rather than calling the get_major_ticks method
which is why you are not getting the full list. This is a bug. I
just made changes in svn so that all the accessor methods
(ax.get_xticklines, ax.get_yticklabels, and friends) all trigger a
call to axis.get_major_ticks rather so they should give the same
results going forward.
JDH
FYI, the Tick attributes are:
tick1line : a Line2D instance
tick2line : a Line2D instance
gridline : a Line2D instance
label1 : a Text
instance
label2 : a Text instance
gridOn : a boolean which determines whether to draw the tickline
tick1On : a boolean which determines whether to draw the 1st tickline
tick2On : a boolean which determines whether to draw the 2nd tickline
label1On : a boolean which determines whether to draw tick label
label2On : a boolean which determines whether to draw tick label
------------------------------
Message: 5
Date: Sat, 29 Sep 2007 21:50:02 -0500
From: "David Loyall" <dav...@th...>
Subject: [Matplotlib-users] Using special characters
To:
mat...@li...
Message-ID:
<957...@ma...>
Content-Type: text/plain; charset=UTF-8
Hello.
I've been having trouble getting Unicode characters to render. I just
get a box in the title of my figure, rather than the character I need.
Here is my code:
#!/usr/bin/env python
from pylab import *
plot([1,2,3,4])
title(u"\u0251")
savefig("test.eps")
savefig("test.png")
show()
That character is LATIN SMALL LETTER ALPHA. It's used in the
International Phonetic Alphabet.
I'm on Linux and I'm using matplotlib 0.90.1-2 (debian package
version). I have a few TTF fonts in my system that contain that
glyph. One is 'Arial Unicode MS', which I copied from my windows
machine.
As you can see, I will need to generate an EPS that renders
the
character... That EPS file will be imported into MS Word on a Windows
PC and printed.
I will happily use any solution that allows me to use that character
in the final product... :) It doesn't have to be unicode..
I believe that my fonts are configured correctly on this Linux
system--I can use the Arial Unicode MS font in Open Office. However,
I'm not sure that MPL is finding them.
When I point the TTFPATH environment variable a directory that only
contains ARIALUNI.TTF, I get gibberish for all characters in my
figure.
When I use ~/.matplotlib/matplotlibrc to list Arial Unicode MS as the
only font in the san-serif family, I don't observe any change in the
text in the figure.
...I did successfully instantiate an FT2FONT object out of my
ARIALUNI.TTF file, but, I didn't know what to do with it at that
point.
Help?
Cheers,
--Dave
Loyall
Omaha, Nebraska, USA
------------------------------
Message: 6
Date: Sun, 30 Sep 2007 12:53:06 +0200
From: "Dirk Zickermann" <dir...@go...>
Subject: Re: [Matplotlib-users] matplotlib - representation of nan
values in 2D
To: Mat...@li...
Message-ID:
<511...@ma...>
Content-Type: text/plain; charset="iso-8859-1"
Dear all,
thanks for your help. this is what I was looking for!
Dirk
2007/9/26, Eric Firing <ef...@ha...>:
>
> David Huard wrote:
> > Hi Dirk,
> >
> > If you haven't already done so, look at the numpy.ma <http://numpy.ma/>
> > module. It provides a masked array object that
deals gracefully with
> > missing values. To the best of my knowledge, most matplotlib functions
> > understand masked arrays and deal with it accordingly, exception made of
> > those requiring a full matrix (such as contour). Take a look at
>
> contour handles masked arrays correctly, as far as I know; contourf has
> some bugs in its masked array handling, but depending on the type and
> distribution of voids, it may still be good enough.
>
> pcolor and image have no problems with masked arrays.
>
> Eric
>
> > examples/image_masked.py. Also, in the Basemap toolkit, there is at
> > least one example showing how to plot a masked array on a map.
> >
> > Cheers,
> >
> > David
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
>
Defy all challenges. Microsoft(R) Visual Studio 2005.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
------------------------------
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
------------------------------
_______________________________________________
Matplotlib-users mailing list
Mat...@li...
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
End of Matplotlib-users Digest, Vol 16, Issue 32
************************************************
____________________________________________________________________________________
¡Sé un mejor asador!
Aprende todo sobre asados.
http://telemundo.yahoo.com/promos/mejorasador.html |
|
From: Eric F. <ef...@ha...> - 2007-10-05 07:25:24
|
gr...@bi... wrote: > Thanks again Eric, > > Your examples are exactly what I was after. Glad to hear it! > My colleague was hypothesizing that there's probably a less-than instead of a less-than-or-equal somewhere, if it is a bug. > That was part of it, but it was a little more subtle. I have tweaked the automatic level generation routine so that it now does what one might reasonably expect. Specifying levels explicitly is still better when you can do it; the number-of-levels method is really only for quick and dirty exploratory work, when you don't care too much which levels are chosen and you don't know in advance what the data interval will be. Eric |
|
From: <gr...@bi...> - 2007-10-05 03:44:38
|
Thanks again Eric,
Your examples are exactly what I was after.
My colleague was hypothesizing that there's probably a less-than instead of a less-than-or-equal somewhere, if it is a bug.
regards,
Gary
---- Eric Firing <ef...@ha...> wrote:
> gr...@bi... wrote:
> > Thanks Eric.
> >
> > However, when I specify the same number of levels as suggested, contourf divides this example into three regions, with a diagonal 'stripe' instead of a clean boundary, so I guess I'm asking whether it's possible to trick contourf into generating a single boundary between the two regions such that it matches that found by contour?
> >
> Now I see the problem; this is something of a corner case, but it may be
> pointing to a bug.
>
> Where do you really want the line to fall?
>
> Do you need to specify the number of contours instead of specifying the
> actual levels (boundaries)? Are you actually dealing with zeros and
> ones as in the example? If so, you probably want
>
> contour(a, [0.5])
> contourf(a, [-1, 0.5, 2], colors=('w', 'k'), extend='neither')
>
> or
>
> contourf(a, [0.5, 2], colors=('k',), extend='neither')
> In this case you are saying "color everything between 0.5 and 2, and
> nothing else".
>
> Specifying one contour instead of giving the levels is yielding 0.6;
> this is a consequence of using the MaxNLocator by default to auto-select
> the levels.
>
> > For the moment, a suitable workaround seems to be to do
> >
> > contourf(a,1,colors=('w','k'))
> >
> > where the background colour is white. This generates what I'm after.
> >
> > I notice also that linewidths is mentioned in the docstring under Obsolete:, but it seems to do nothing, so it should probably be removed from the docstring.
>
> I will fix the docstring. Thanks.
>
> Eric
> >
> > thanks again,
> > Gary
> >
> > ---- Eric Firing <ef...@ha...> wrote:
> >> Gary Ruben wrote:
> >>> I'm notice that contourf behaves differently to contour by default in
> >>> where it decides to position contours. For example, using pylab, if you try
> >>>
> >>> a=tri(10)
> >>> contourf(a,0)
> >>> contour(a,1)
> >>>
> >>> I'd have expected the contours to line up, but they don't. Is there a
> >>> way to get contourf to place its contours at the same position as contour?
> >> Specify the same number of levels:
> >>
> >> contourf(a,1)
> >> contour(a,1)
> >>
> >>
> >> That takes care of this simple case. There are other cases, however,
> >> where contour and contourf simply don't agree; contouring is ambiguous,
> >> and only part of the algorithm is shared between contour and contourf.
> >> For well-behaved datasets this is normally not a problem, but it becomes
> >> obvious if you contour a random array.
> >>
> >> Eric
> >
>
|
|
From: Eric F. <ef...@ha...> - 2007-10-05 02:58:47
|
gr...@bi... wrote:
> Thanks Eric.
>
> However, when I specify the same number of levels as suggested, contourf divides this example into three regions, with a diagonal 'stripe' instead of a clean boundary, so I guess I'm asking whether it's possible to trick contourf into generating a single boundary between the two regions such that it matches that found by contour?
>
Now I see the problem; this is something of a corner case, but it may be
pointing to a bug.
Where do you really want the line to fall?
Do you need to specify the number of contours instead of specifying the
actual levels (boundaries)? Are you actually dealing with zeros and
ones as in the example? If so, you probably want
contour(a, [0.5])
contourf(a, [-1, 0.5, 2], colors=('w', 'k'), extend='neither')
or
contourf(a, [0.5, 2], colors=('k',), extend='neither')
In this case you are saying "color everything between 0.5 and 2, and
nothing else".
Specifying one contour instead of giving the levels is yielding 0.6;
this is a consequence of using the MaxNLocator by default to auto-select
the levels.
> For the moment, a suitable workaround seems to be to do
>
> contourf(a,1,colors=('w','k'))
>
> where the background colour is white. This generates what I'm after.
>
> I notice also that linewidths is mentioned in the docstring under Obsolete:, but it seems to do nothing, so it should probably be removed from the docstring.
I will fix the docstring. Thanks.
Eric
>
> thanks again,
> Gary
>
> ---- Eric Firing <ef...@ha...> wrote:
>> Gary Ruben wrote:
>>> I'm notice that contourf behaves differently to contour by default in
>>> where it decides to position contours. For example, using pylab, if you try
>>>
>>> a=tri(10)
>>> contourf(a,0)
>>> contour(a,1)
>>>
>>> I'd have expected the contours to line up, but they don't. Is there a
>>> way to get contourf to place its contours at the same position as contour?
>> Specify the same number of levels:
>>
>> contourf(a,1)
>> contour(a,1)
>>
>>
>> That takes care of this simple case. There are other cases, however,
>> where contour and contourf simply don't agree; contouring is ambiguous,
>> and only part of the algorithm is shared between contour and contourf.
>> For well-behaved datasets this is normally not a problem, but it becomes
>> obvious if you contour a random array.
>>
>> Eric
>
|
|
From: <gr...@bi...> - 2007-10-05 01:14:46
|
Thanks Eric.
However, when I specify the same number of levels as suggested, contourf divides this example into three regions, with a diagonal 'stripe' instead of a clean boundary, so I guess I'm asking whether it's possible to trick contourf into generating a single boundary between the two regions such that it matches that found by contour?
For the moment, a suitable workaround seems to be to do
contourf(a,1,colors=('w','k'))
where the background colour is white. This generates what I'm after.
I notice also that linewidths is mentioned in the docstring under Obsolete:, but it seems to do nothing, so it should probably be removed from the docstring.
thanks again,
Gary
---- Eric Firing <ef...@ha...> wrote:
> Gary Ruben wrote:
> > I'm notice that contourf behaves differently to contour by default in
> > where it decides to position contours. For example, using pylab, if you try
> >
> > a=tri(10)
> > contourf(a,0)
> > contour(a,1)
> >
> > I'd have expected the contours to line up, but they don't. Is there a
> > way to get contourf to place its contours at the same position as contour?
>
> Specify the same number of levels:
>
> contourf(a,1)
> contour(a,1)
>
>
> That takes care of this simple case. There are other cases, however,
> where contour and contourf simply don't agree; contouring is ambiguous,
> and only part of the algorithm is shared between contour and contourf.
> For well-behaved datasets this is normally not a problem, but it becomes
> obvious if you contour a random array.
>
> Eric
|
|
From: Gary R. <gr...@bi...> - 2007-10-04 22:35:55
|
I'm notice that contourf behaves differently to contour by default in where it decides to position contours. For example, using pylab, if you try a=tri(10) contourf(a,0) contour(a,1) I'd have expected the contours to line up, but they don't. Is there a way to get contourf to place its contours at the same position as contour? thanks, Gary |
|
From: Robert K. <rob...@gm...> - 2007-10-04 20:54:34
|
David D Clark wrote:
> Hi Folks,
>
> I have an array A=f(x) with a family of curves. Is there an easy way to
> get a different marker for each line of plot(x,A).
Use itertools.cycle() to make an iterator that goes round-and-round. Use
itertools.izip() to match it up with your data, and perhaps a set of colors, too.
import itertools
def marker_cycle():
""" Return an infinite, cycling iterator over the available marker symbols.
This is wrapped in a function to make sure that you get a new iterator
that starts at the beginning every time you request one.
"""
return itertools.cycle([
'o','^','v','<','>',
's','+','x','D','d',
'1','2','3','4','h',
'H','p','|','_'])
for kk, m in itertools.izip(range(A.shape[0]), marker_cycle()):
loglog(f, A[kk], linestyle='-', marker=m, lw=2)
--
Robert Kern
"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying truth."
-- Umberto Eco
|
|
From: David D C. <dd...@la...> - 2007-10-04 18:29:12
|
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi Folks,
I have an array A=f(x) with a family of curves. Is there an easy way to
get a different marker for each line of plot(x,A). This is what I
currently have:
mrkrs=array(['o','^','v','<','>',
's','+','x','D','d',
'1','2','3','4','h',
'H','p','|','_'])
ii=0
for kk in arange(A.shape[0]):
loglog(f,A[kk],
linestyle='-',
marker=mrkrs[ii],
lw=2)
if ii < mrkrs.size-1:
ii+=1
else:
ii=0
This works, but it's not very elegant.
Thanks,
Dave
- --
David D. Clark
Electrical Engineer
P-23, Neutron Science and Technology
e-mail mailto:dd...@la...
GPG Public key 0x018D6523 available at http://pgp.mit.edu
http://www.gnupg.org has information about public key cryptography
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org
iD8DBQFHBTDkNu7GcwGNZSMRAgFkAJ9wddLwHjGCI805Jb6jokaHjSwGPwCgjwh/
iTbqezvL5vHIv5JGRxAVPyo=
=hOfF
-----END PGP SIGNATURE-----
|
|
From: John H. <jd...@gm...> - 2007-10-04 16:32:04
|
On 10/1/07, Iacopo <iac...@gm...> wrote: > Hi everybody, > > I tried: > > >>> import pylab > >>> pylab.plot(["a", "b", "c"], [1, 2, 3]) > > ValueError: invalid literal for float(): a > > Well, I expected that. I wrote this to just explain my trouble: printing > strings instead float along x-axes (a sort of mapping floats to strings...). > Writing that pylab.plot I mean that "a", "b", "c" were equalli spaced and > "a" --> 1, "b" --> 2, "c" --> 3. I think it could be a reasonnable command. > Is there something similar? pylab.plot([1,2,3], [4,5,6]) pylab.xticks([1,2,3], ['a', 'b', 'c']) |
|
From: Jeff W. <js...@fa...> - 2007-10-04 14:49:40
|
Lionel Roubeyrie wrote: > Hi Jeff, > I've saw that, but I have the smalls images coordinates in geographic system, > then I need to recompute their position everytime the user will change the > figure's aspect, ... Not very usefull. Is there a way to extend the missing > areas around each small image by a "transparent" value, and put this new > image layer on the background image? Lionel: Not sure what you mean here, but you plot masked arrays with imshow, making the missing values transparent (see the image_masked.py example). Perhaps you could pad the 'small' image with missing values so that it's the same size as the background image, then just plot it over the top with basemap.imshow(). > My last chance is to perform the > operation directly with PIL, but BTW, I'll lose Basemap projections > facilities. > As a last resort you can perform the layering with PIL, the plot the PIL image with matplotlib (see image_demo3.py and geos_demo_2.py in the basemap examples). -Jeff > Le jeudi 04 octobre 2007, Jeff Whitaker a écrit : > >> Lionel: I think you'll need to add other axes to the figure, and then >> draw the image with axes.imshow. >> >> See http://matplotlib.sourceforge.net/screenshots/axes_demo.py for an >> example of how to use inset axes. >> >> -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: John H. <jd...@gm...> - 2007-10-04 14:32:45
|
On 10/4/07, Chris <lis...@ma...> wrote: > Is there a way of forcing them to install? I dont mind going in and > deleting things by hand myself, but I am trying to have a build that > installs for almost everyone with minimum tinkering. Yes, just edit setup.py and remove the conditional checks and simply call # always add these to the installer add_pytz() add_dateutil() If you need something in the mpl build itself, eg so you can track svn or future releases, we could probably support an environment variable or something like it. JDH |
|
From: Lionel R. <lro...@li...> - 2007-10-04 13:55:45
|
Hi Jeff, I've saw that, but I have the smalls images coordinates in geographic syste= m, then I need to recompute their position everytime the user will change the= =20 figure's aspect, ... Not very usefull. Is there a way to extend the missing= =20 areas around each small image by a "transparent" value, and put this new=20 image layer on the background image? My last chance is to perform the=20 operation directly with PIL, but BTW, I'll lose Basemap projections=20 facilities. Le jeudi 04 octobre 2007, Jeff Whitaker a =E9crit=A0: > Lionel: I think you'll need to add other axes to the figure, and then > draw the image with axes.imshow. > > See http://matplotlib.sourceforge.net/screenshots/axes_demo.py for an > example of how to use inset axes. > > -Jeff =2D-=20 Lionel Roubeyrie - lro...@li... Charg=E9 d'=E9tudes et de maintenance LIMAIR - la Surveillance de l'Air en Limousin http://www.limair.asso.fr |
|
From: Chris <lis...@ma...> - 2007-10-04 13:22:50
|
John Hunter <jdh2358@...> writes: > > On 7/17/07, Chris Fonnesbeck <listservs@...> wrote: > > For some reason, builds from SVN dont install either pytz > > or dateutil (at least not in the right place). Importing pylab > > from these builds results in an import error. > > > This is typically caused when the install process detects that pytz > and dateutil are already installed, and so doesn't overright them. My > guess is that they were available in your PYTHONPATH at install time > but not at run time. So at install time they are detected and not > installed, but at run time they cannot be found. If this is the > solution, you need to build and run in the same environment, or blow > away existing copies of pytz and dateutil whereever they are lurking > and then reinstall mpl. Use the __file__ module attr to poke around > and see if you can find them. Is there a way of forcing them to install? I dont mind going in and deleting things by hand myself, but I am trying to have a build that installs for almost everyone with minimum tinkering. |
|
From: Jeff W. <js...@fa...> - 2007-10-04 11:15:07
|
Lionel Roubeyrie wrote: > Hi all, > I think it's a trivial question, but don't find a solution: > Drawing an image with imshow (in fact basemap.imshow), I need to put others > images on it, but smallers, at specified locations. > Is there a way to do so, I have tried with extent parameter, but doesn't do > what I expect? > Thanks > Lionel: I think you'll need to add other axes to the figure, and then draw the image with axes.imshow. See http://matplotlib.sourceforge.net/screenshots/axes_demo.py for an example of how to use inset axes. -Jeff -- Jeffrey S. Whitaker Phone : (303)497-6313 NOAA/OAR/CDC R/PSD1 FAX : (303)497-6449 325 Broadway Boulder, CO, USA 80305-3328 |
|
From: Lionel R. <lro...@li...> - 2007-10-04 08:43:59
|
Hi all, I think it's a trivial question, but don't find a solution: Drawing an image with imshow (in fact basemap.imshow), I need to put others= =20 images on it, but smallers, at specified locations. Is there a way to do so, I have tried with extent parameter, but doesn't do= =20 what I expect? Thanks =2D-=20 Lionel Roubeyrie - lro...@li... Charg=C3=A9 d'=C3=A9tudes et de maintenance LIMAIR - la Surveillance de l'Air en Limousin http://www.limair.asso.fr |
|
From: Wayne E. H. <wh...@pa...> - 2007-10-04 05:50:52
|
Eric:
First thanks for all the help. Here's the scoop after I replied to your
earlier post. I thought a bit about the sense of where you were going
(it always helps to think a bit). So I decided to try compiling
matplotlib with the GTK backend instead of Tk. I have gtk-2.11.5. So
I did some sed's to the setup.py file:
sed -i "s|BUILD_GTKAGG = 'auto'|BUILD_GTKAGG = 1|" setup.py &&
sed -i "s|BUILD_GTK = 'auto'|BUILD_GTK = 1|" setup.py &&
sed -i "s|BUILD_TKAGG = 'auto'|BUILD_TKAGG = 0|" setup.py &&
and then proceeded. It turned out that I needed pygtk, so I downloaded
that and installed it, but pygtk still complained about not having
pycairo (which it says is optional), so I downloaded that. Making a
long story short, installing pycairo-1.4.0, pyobject-2.14.0,
pygtk-2.10.6 and then reinstalling matplotlib with the above sed's did
the trick. I'm displaying all the plots I have been able to in XP (so I
don't need XP any more, at least at home).
Once again, thanks for the suggestions. Although I'm set here, I wonder
about the tcl/tk issue with matplotlib. I am using tcl/tk-8.4.15. I
wonder if it's too new ? Or is there some other package that is needed ?
Wayne
Eric Firing wrote:
> Wayne,
>
> Segfaults are generally caused by problems in extension code or
> libraries. The fact that the plotting works with a non-gui backend
> indicates that the problem is not in matplotlib's transform or Agg
> extension code, or in the bits of numpy code that get used along the
> way. I was pretty sure this would be the case; all of those
> components are solid and well-tested together, at least for simple
> plotting.
>
> That tends to throw suspicion on Tkinter/Tk/Tcl or one of mpl's
> extension bits that is run with Tk. I'm not sure there are any in
> this case.
>
> One way to narrow it down is to try another gui: gtk or qt. Do you
> have either of these libraries installed?
>
> Eric
>
> Wayne E. Harlan wrote:
>>
>>
>> Eric Firing wrote:
>>> Wayne,
>>>
>>> I'm stumped. Do you get a segfault only with the gui backend? Can
>>> you you do this:
>>>
>>> import matplotlib
>>> matplotlib.use('Agg')
>>> import pylab
>>> pylab.plot([1,2,3])
>>> pylab.savefig('test.png')
>>>
>>> Eric
>> <previous stuff snipped>
>>
>> OK, this worked. I have attached the test,png file that resulted.
>> But I don't quite know what this means ...
>>
>> IDLE 1.2.1 >>> import matplotlib
>> >>> matplotlib.use('Agg')
>> >>> import pylab
>> >>> pylab.plot([1,2,3])
>> [<matplotlib.lines.Line2D instance at 0x87cd56c>]
>> >>> pylab.savefig('test.png')
>> >>>
>>
>> The other suggestion from Michael about using gdb will have to wait
>> until I download, install and learn to use it, but if that's
>> required, that's what I'll do.
>>
>> Thanks
>>
>> Wayne
>>
>>
>> ------------------------------------------------------------------------
>>
>
>
|
|
From: Eric F. <ef...@ha...> - 2007-10-04 02:53:36
|
Wayne,
Segfaults are generally caused by problems in extension code or
libraries. The fact that the plotting works with a non-gui backend
indicates that the problem is not in matplotlib's transform or Agg
extension code, or in the bits of numpy code that get used along the
way. I was pretty sure this would be the case; all of those components
are solid and well-tested together, at least for simple plotting.
That tends to throw suspicion on Tkinter/Tk/Tcl or one of mpl's
extension bits that is run with Tk. I'm not sure there are any in this
case.
One way to narrow it down is to try another gui: gtk or qt. Do you have
either of these libraries installed?
Eric
Wayne E. Harlan wrote:
>
>
> Eric Firing wrote:
>> Wayne,
>>
>> I'm stumped. Do you get a segfault only with the gui backend? Can
>> you you do this:
>>
>> import matplotlib
>> matplotlib.use('Agg')
>> import pylab
>> pylab.plot([1,2,3])
>> pylab.savefig('test.png')
>>
>> Eric
> <previous stuff snipped>
>
> OK, this worked. I have attached the test,png file that resulted. But
> I don't quite know what this means ...
>
> IDLE 1.2.1 >>> import matplotlib
> >>> matplotlib.use('Agg')
> >>> import pylab
> >>> pylab.plot([1,2,3])
> [<matplotlib.lines.Line2D instance at 0x87cd56c>]
> >>> pylab.savefig('test.png')
> >>>
>
> The other suggestion from Michael about using gdb will have to wait
> until I download, install and learn to use it, but if that's required,
> that's what I'll do.
>
> Thanks
>
> Wayne
>
>
> ------------------------------------------------------------------------
>
|
|
From: Wayne E. H. <wh...@pa...> - 2007-10-04 02:26:25
|
Eric Firing wrote:
> Wayne,
>
> I'm stumped. Do you get a segfault only with the gui backend? Can
> you you do this:
>
> import matplotlib
> matplotlib.use('Agg')
> import pylab
> pylab.plot([1,2,3])
> pylab.savefig('test.png')
>
> Eric
<previous stuff snipped>
OK, this worked. I have attached the test,png file that resulted. But
I don't quite know what this means ...
IDLE 1.2.1
>>> import matplotlib
>>> matplotlib.use('Agg')
>>> import pylab
>>> pylab.plot([1,2,3])
[<matplotlib.lines.Line2D instance at 0x87cd56c>]
>>> pylab.savefig('test.png')
>>>
The other suggestion from Michael about using gdb will have to wait
until I download, install and learn to use it, but if that's required,
that's what I'll do.
Thanks
Wayne
|
|
From: Michael D. <md...@st...> - 2007-10-03 19:02:21
|
I'll second Eric's suggestion.
It might also help to have a backtrace from gdb in addition to your
strace output.
Cheers,
Mike
Wayne E. Harlan wrote:
> Eric Firing wrote:
>> If a straightforward plotting sequence, such as one of the examples,
>> does this, then it sounds like a broken installation, not a matplotlib
>> bug.
>>
> Based on your comment above, here are my particulars:
>
> 1) System is LinuxFromScratch recently built from their SVN book:
> glibc is 2.5, gcc is 4.1.2, X is Xorg 7.2 installed in /usr.
>
> 2) Python 2.5.1 with Tkinter enabled. If I run the following script,
> I get the 'quit' button which when clicked makes the button/window
> disappear, so I know python and Tkinter are working.
>
> #!/usr/bin/python
> from Tkinter import *
> class Application(Frame):
> def __init__(self, master=None):
> Frame.__init__(self, master)
> self.grid()
> self.createWidgets()
> def createWidgets(self):
> self.quitButton = Button ( self, text="Quit",command=self.quit )
> self.quitButton.grid()
> app = Application()
> app.master.title("Sample application")
> app.mainloop()
>
> 3) Numpy 1.0.3.1 installed without any errors and I can do the following:
>
> >>> import numpy
> >>> List = dir(numpy)
> >>> len(List)
> 491
> >>>
>
> 4) Matplotlib 0.90.1 also installed without error. I set
> BUILD_TKAGG = 1 which may not have been necessary, but it seems to
> have worked since in my matplotlibrc file I find "backend :
> TkAgg". Then if I do this
> " python simple_plot.py --verbose-debug", I get the output in the
> simple_output attachment. The font errors there are the same as what I
> get in each of my 3 XP installations where matplotlib works just fine,
> so I don't think they are the cause of the segfault. As I may have
> described previously, the plot window appears for a fraction of a second
> and then disappears as the segfault occurs.
>
> I also ran "strace python simple_plot.py --verbose-debug" with the
> output that's in the strace_output attachment to see if that would give
> any more information but that output ends at the segfault and I am not
> knowledgeable enough to understand what it says.
>
> Any help will be appreciated.
>
> Best Regards,
>
> Wayne
>
>
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2005.
> 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: Eric F. <ef...@ha...> - 2007-10-03 18:56:12
|
Wayne,
I'm stumped. Do you get a segfault only with the gui backend? Can you
you do this:
import matplotlib
matplotlib.use('Agg')
import pylab
pylab.plot([1,2,3])
pylab.savefig('test.png')
Eric
Wayne E. Harlan wrote:
> Eric Firing wrote:
>> If a straightforward plotting sequence, such as one of the examples,
>> does this, then it sounds like a broken installation, not a matplotlib
>> bug.
>>
> Based on your comment above, here are my particulars:
>
> 1) System is LinuxFromScratch recently built from their SVN book:
> glibc is 2.5, gcc is 4.1.2, X is Xorg 7.2 installed in /usr.
>
> 2) Python 2.5.1 with Tkinter enabled. If I run the following script,
> I get the 'quit' button which when clicked makes the button/window
> disappear, so I know python and Tkinter are working.
>
> #!/usr/bin/python
> from Tkinter import *
> class Application(Frame):
> def __init__(self, master=None):
> Frame.__init__(self, master)
> self.grid()
> self.createWidgets()
> def createWidgets(self):
> self.quitButton = Button ( self, text="Quit",command=self.quit )
> self.quitButton.grid()
> app = Application()
> app.master.title("Sample application")
> app.mainloop()
>
> 3) Numpy 1.0.3.1 installed without any errors and I can do the following:
>
> >>> import numpy
> >>> List = dir(numpy)
> >>> len(List)
> 491
> >>>
>
> 4) Matplotlib 0.90.1 also installed without error. I set
> BUILD_TKAGG = 1 which may not have been necessary, but it seems to
> have worked since in my matplotlibrc file I find "backend :
> TkAgg". Then if I do this
> " python simple_plot.py --verbose-debug", I get the output in the
> simple_output attachment. The font errors there are the same as what I
> get in each of my 3 XP installations where matplotlib works just fine,
> so I don't think they are the cause of the segfault. As I may have
> described previously, the plot window appears for a fraction of a second
> and then disappears as the segfault occurs.
>
> I also ran "strace python simple_plot.py --verbose-debug" with the
> output that's in the strace_output attachment to see if that would give
> any more information but that output ends at the segfault and I am not
> knowledgeable enough to understand what it says.
>
> Any help will be appreciated.
>
> Best Regards,
>
> Wayne
>
>
> ------------------------------------------------------------------------
>
> [wayne@holmes] ~/Programming/Python/matplotlib/examples: python simple_plot.py --verbose-debug
> matplotlib data path /usr/lib/python2.5/site-packages/matplotlib/mpl-data
> $HOME=/home/wayne
> CONFIGDIR=/home/wayne/.matplotlib
> loaded rc file /home/wayne/.matplotlib/matplotlibrc
> matplotlib version 0.90.1
> verbose.level debug
> interactive is False
> units is True
> platform is linux2
> loaded modules: ['pylab', 'distutils.distutils', '_bisect', '__future__', 'copy_reg',
> 'sre_compile', 'distutils', 'itertools', '_hashlib', '_sre', '__main__', 'site', '__
> builtin__', 'datetime', 'matplotlib.re', 'matplotlib.tempfile', 'encodings', 'encodin
> gs.encodings', 'shutil', 'distutils.string', 'dateutil', 'matplotlib.datetime', 'posi
> xpath', '_random', 'tempfile', 'errno', 'matplotlib.warnings', 'binascii', 'encodings
> .codecs', 'sre_constants', 're', 'matplotlib.md5', 'os.path', 'pytz.sys', '_codecs',
> 'distutils.sysconfig', 'pytz.sets', 'math', 'fcntl', 'stat', 'zipimport', 'string', '
> warnings', 'encodings.types', 'UserDict', 'encodings.ascii', 'matplotlib.sys', 'matpl
> otlib', 'distutils.os', 'sys', 'pytz.tzinfo', 'pytz', 'pytz.datetime', 'matplotlib.__
> future__', 'codecs', 'distutils.re', 'matplotlib.pytz', 'types', 'md5', '_types', 'ma
> tplotlib.dateutil', 'hashlib', 'matplotlib.os', 'thread', 'bisect', 'matplotlib.distu
> tils', 'signal', 'distutils.errors', 'random', 'linecache', 'matplotlib.shutil', 'pos
> ix', 'encodings.aliases', 'sets', 'exceptions', 'sre_parse', 'pytz.bisect', 'distutil
> s.sys', 'os', 'strop']
> numerix numpy 1.0.3.1
> font search path ['/usr/lib/python2.5/site-packages/matplotlib/mpl-data/fonts/ttf', '
> /usr/lib/python2.5/site-packages/matplotlib/mpl-data/fonts/afm']
> trying fontname /usr/lib/python2.5/site-packages/matplotlib/mpl-data/fonts/ttf/VeraMo
> BI.ttf
> trying fontname /usr/lib/python2.5/site-packages/matplotlib/mpl-data/fonts/ttf/VeraSe
> .ttf
> trying fontname /usr/lib/python2.5/site-packages/matplotlib/mpl-data/fonts/ttf/cmmi10
> .ttf
> trying fontname /usr/lib/python2.5/site-packages/matplotlib/mpl-data/fonts/ttf/VeraSe
> Bd.ttf
> trying fontname /usr/lib/python2.5/site-packages/matplotlib/mpl-data/fonts/ttf/cmsy10
> .ttf
> trying fontname /usr/lib/python2.5/site-packages/matplotlib/mpl-data/fonts/ttf/VeraIt
> .ttf
> trying fontname /usr/lib/python2.5/site-packages/matplotlib/mpl-data/fonts/ttf/cmr10.
> ttf
> trying fontname /usr/lib/python2.5/site-packages/matplotlib/mpl-data/fonts/ttf/cmex10
> .ttf
> trying fontname /usr/lib/python2.5/site-packages/matplotlib/mpl-data/fonts/ttf/cmtt10
> .ttf
> trying fontname /usr/lib/python2.5/site-packages/matplotlib/mpl-data/fonts/ttf/Vera.t
> tf
> loaded ttfcache file /home/wayne/.matplotlib/ttffont.cache
> backend TkAgg version 8.4
> findfont failed Bitstream Vera Serif, New Century Schoolbook, Century Schoolb
> ook L, Utopia, ITC Bookman, Bookman, Nimbus Roman No9 L, Times New Roman, Times, Pala
> tino, Charter, serif
> Could not match Bitstream Vera Serif, New Century Schoolbook, Century Schoolbook L, U
> topia, ITC Bookman, Bookman, Nimbus Roman No9 L, Times New Roman, Times, Palatino, Ch
> arter, serif, normal, normal. Returning /usr/lib/python2.5/site-packages/matplotlib/
> mpl-data/fonts/ttf/Vera.ttf
> findfont failed Bitstream Vera Serif, New Century Schoolbook, Century Schoolb
> ook L, Utopia, ITC Bookman, Bookman, Nimbus Roman No9 L, Times New Roman, Times, Pala
> tino, Charter, serif, normal, normal 400, normal, 14.0
> Could not match Bitstream Vera Serif, New Century Schoolbook, Century Schoolbook L, U
> topia, ITC Bookman, Bookman, Nimbus Roman No9 L, Times New Roman, Times, Palatino, Ch
> arter, serif, normal, normal. Returning /usr/lib/python2.5/site-packages/matplotlib/
> mpl-data/fonts/ttf/Vera.ttf
> Segmentation fault (core dumped)
> [wayne@holmes] ~/Programming/Python/matplotlib/examples:
>
>
> ------------------------------------------------------------------------
>
> futex(0x81d3cc0, FUTEX_WAKE, 1) = 0
> futex(0x81d3cc0, FUTEX_WAKE, 1) = 0
> futex(0x81d3cc0, FUTEX_WAKE, 1) = 0
> futex(0x81d3cc0, FUTEX_WAKE, 1) = 0
> futex(0x81d3cc0, FUTEX_WAKE, 1) = 0
> futex(0x81d3cc0, FUTEX_WAKE, 1) = 0
> futex(0x81d3cc0, FUTEX_WAKE, 1) = 0
> futex(0x81d3cc0, FUTEX_WAKE, 1) = 0
> futex(0x81d3cc0, FUTEX_WAKE, 1) = 0
> futex(0x81d3cc0, FUTEX_WAKE, 1) = 0
> futex(0x81d3cc0, FUTEX_WAKE, 1) = 0
> futex(0x81d3cc0, FUTEX_WAKE, 1) = 0
> futex(0x81d3cc0, FUTEX_WAKE, 1) = 0
> futex(0x81d3cc0, FUTEX_WAKE, 1) = 0
> munmap(0xb6301000, 1921024) = 0
> munmap(0xb64d6000, 1921024) = 0
> futex(0x81d3cc0, FUTEX_WAKE, 1) = 0
> lstat64("/usr", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
> lstat64("/usr/lib", {st_mode=S_IFDIR|0755, st_size=8192, ...}) = 0
> lstat64("/usr/lib/tk8.4", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
> open("/usr/lib/tk8.4/tclIndex", O_RDONLY|O_LARGEFILE) = 6
> fcntl64(6, F_SETFD, FD_CLOEXEC) = 0
> ioctl(6, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbfcdda28) = -1 ENOTTY (Inappropriate ioctl for device)
> read(6, "# Tcl autoload index file, versi"..., 4096) = 4096
> read(6, "]]\nset auto_index(::tk::FocusGro"..., 4096) = 4096
> read(6, "::tk::MenuDownArrow) [list sourc"..., 4096) = 4096
> read(6, " [list source [file join $dir sp"..., 4096) = 4096
> read(6, "\nset auto_index(::tk::IconList_A"..., 4096) = 4096
> read(6, "_InterpFilter) [list source [fil"..., 4096) = 1730
> read(6, "", 4096) = 0
> close(6) = 0
> lstat64("/usr", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
> lstat64("/usr/lib", {st_mode=S_IFDIR|0755, st_size=8192, ...}) = 0
> open("/usr/lib/tclIndex", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
> lstat64("/usr", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
> lstat64("/usr/lib", {st_mode=S_IFDIR|0755, st_size=8192, ...}) = 0
> lstat64("/usr/lib/tcl8.4", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
> open("/usr/lib/tcl8.4/tclIndex", O_RDONLY|O_LARGEFILE) = 6
> fcntl64(6, F_SETFD, FD_CLOEXEC) = 0
> ioctl(6, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbfcdda28) = -1 ENOTTY (Inappropriate ioctl for device)
> read(6, "# Tcl autoload index file, versi"..., 4096) = 4096
> read(6, "Name) [list source [file join $d"..., 4096) = 2001
> read(6, "", 4096) = 0
> close(6) = 0
> futex(0x81d3cc0, FUTEX_WAKE, 1) = 0
> futex(0x81d3cc0, FUTEX_WAKE, 1) = 0
> --- SIGSEGV (Segmentation fault) @ 0 (0) ---
> +++ killed by SIGSEGV (core dumped) +++
> Process 1826 detached
> [wayne@holmes] ~/Programming/Python/matplotlib/examples:
|
|
From: Wayne E. H. <wh...@pa...> - 2007-10-03 02:55:14
|
Eric Firing wrote:
> If a straightforward plotting sequence, such as one of the examples,
> does this, then it sounds like a broken installation, not a matplotlib
> bug.
>
Based on your comment above, here are my particulars:
1) System is LinuxFromScratch recently built from their SVN book:
glibc is 2.5, gcc is 4.1.2, X is Xorg 7.2 installed in /usr.
2) Python 2.5.1 with Tkinter enabled. If I run the following script,
I get the 'quit' button which when clicked makes the button/window
disappear, so I know python and Tkinter are working.
#!/usr/bin/python
from Tkinter import *
class Application(Frame):
def __init__(self, master=None):
Frame.__init__(self, master)
self.grid()
self.createWidgets()
def createWidgets(self):
self.quitButton = Button ( self, text="Quit",command=self.quit )
self.quitButton.grid()
app = Application()
app.master.title("Sample application")
app.mainloop()
3) Numpy 1.0.3.1 installed without any errors and I can do the following:
>>> import numpy
>>> List = dir(numpy)
>>> len(List)
491
>>>
4) Matplotlib 0.90.1 also installed without error. I set
BUILD_TKAGG = 1 which may not have been necessary, but it seems to
have worked since in my matplotlibrc file I find "backend :
TkAgg". Then if I do this
" python simple_plot.py --verbose-debug", I get the output in the
simple_output attachment. The font errors there are the same as what I
get in each of my 3 XP installations where matplotlib works just fine,
so I don't think they are the cause of the segfault. As I may have
described previously, the plot window appears for a fraction of a second
and then disappears as the segfault occurs.
I also ran "strace python simple_plot.py --verbose-debug" with the
output that's in the strace_output attachment to see if that would give
any more information but that output ends at the segfault and I am not
knowledgeable enough to understand what it says.
Any help will be appreciated.
Best Regards,
Wayne
|
|
From: David D C. <dd...@la...> - 2007-10-02 17:32:52
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Alan, Thanks for the help. This was a big clue. It turns out that what I thought was an array of arrays was actually a list of arrays. If my list was y, running plot(x,array(y).transpose()) solved the problem! Thanks for your help, Dave Alan G Isaac wrote: > On Mon, 01 Oct 2007, David D Clark apparently wrote: >> y=[array([<f(x0)>]),array([<f(x1)>]),array([<f(x2)>])...] >> and x=array([x0,x1,x2,...]) > >> I want to plot the family of curves y=f(x). >> plot(x,y[n]) where n is the nth array in y plots the correct curve, >> however plot(x,y) and plot(x,y[:]) complain about mismatched array >> dimensions. > > > Might you want > plot(x,y.transpose()) > > hth, > Alan Isaac > > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users - -- David D. Clark Electrical Engineer P-23, Neutron Science and Technology e-mail mailto:dd...@la... GPG Public key 0x018D6523 available at http://pgp.mit.edu http://www.gnupg.org has information about public key cryptography -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org iD8DBQFHAoCvNu7GcwGNZSMRAmlVAJ46vuGaTNmGg0GDvPY7FzAdWhk9sACeIWpY i12r6Utl4pLzyabsxCCP+Dw= =jWKL -----END PGP SIGNATURE----- |
|
From: Eric F. <ef...@ha...> - 2007-10-02 17:22:40
|
John Hunter wrote: > On 10/2/07, Lars Friedrich <lfr...@im...> wrote: >> Hello all, >> >> I am using matplotlib.mlab.psd to find power spectra of measured data. >> Sometimes it happens that I use the automatic zero padding (if the >> length of my measured data is smaller than nFFT) and detrending >> (pylab.detrend_mean) at the same time. >> >> I think that the psd-algorithm does the zero padding *first* and *then* >> uses the detrend function. >> >> For my application this is not good because it introduces low-frequency >> signals that I can see in the spectrum. So the detrending does not work >> as good as it does when there is no zero padding. >> >> What is the reason for this order of applying zero padding and >> detrending? Wouldn't it make sense to change it? > > I wrote this function many years ago and do not remember why I choose > the order pad then detrend, but what you propose makes sense, so let's > let this percolate for a bit and if noone objects I will change it > (and related functions). The change makes sense to me also. Eric |
|
From: John H. <jd...@gm...> - 2007-10-02 13:41:24
|
On 10/2/07, Lars Friedrich <lfr...@im...> wrote: > Hello all, > > I am using matplotlib.mlab.psd to find power spectra of measured data. > Sometimes it happens that I use the automatic zero padding (if the > length of my measured data is smaller than nFFT) and detrending > (pylab.detrend_mean) at the same time. > > I think that the psd-algorithm does the zero padding *first* and *then* > uses the detrend function. > > For my application this is not good because it introduces low-frequency > signals that I can see in the spectrum. So the detrending does not work > as good as it does when there is no zero padding. > > What is the reason for this order of applying zero padding and > detrending? Wouldn't it make sense to change it? I wrote this function many years ago and do not remember why I choose the order pad then detrend, but what you propose makes sense, so let's let this percolate for a bit and if noone objects I will change it (and related functions). JDH |