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
(7)
2
(5)
3
(18)
4
(9)
5
(13)
6
(14)
7
(8)
8
(7)
9
(6)
10
(6)
11
(24)
12
(14)
13
(9)
14
(21)
15
(6)
16
(1)
17
(20)
18
(42)
19
(16)
20
(21)
21
(41)
22
(13)
23
(11)
24
(15)
25
(32)
26
(27)
27
(29)
28
(10)
29
(3)
30
(1)
31
(5)





Showing results of 450

<< < 1 .. 3 4 5 6 7 .. 18 > >> (Page 5 of 18)
From: Wolfgang K. <wke...@go...> - 2008年03月25日 13:58:46
Hello,
I have some trouble with ipython and matplotlib. I create a figure in 
one of my functions that I call from ipython. The first time it runs 
fine and I can use the figure interactively (selecting/ deselcting 
points and so on). The second time I run it, the code doesnt stop but 
continues without halting at the show routine.
I'm doing this on a Mac (10.5.2/ Intel). On my Linux machine I did 
pylab.get_current_figure_manager().destroy() and bound it to a key to 
prevent this. If I do this on the mac (WXAgg) The next time I want to 
plot it complains about a deleted C++ extension and doesnt plot at all.
Please help
 Wolfgang
From: Darren D. <dar...@co...> - 2008年03月25日 12:17:38
On Monday 24 March 2008 01:52:27 pm Brook Lin wrote:
> After installation, I only ran a simple code attached below. I found that I
> got this run time error from "from pylab import *".
>
> I did go through what Mark Hamilton posted:
> Index: cutils.py
> ===================================================================
> --- cutils.py (revision 5001)
> +++ cutils.py (working copy)
> @@ -79,7 +79,7 @@
> raise RuntimeError("""\
> '%s' is not a writable dir; you must set %s/.matplotlib to be a writable
> dir.
> You can also set environment variable MPLCONFIGDIR to any writable
> directory
> -where you want matplotlib data stored """%h)
> +where you want matplotlib data stored """%(p,h))
> else:
> if not is_writable_dir(h):
> raise RuntimeError("Failed to create %s/.matplotlib; consider
> setting MPLCONFIGDIR to a writable directory for matplotlib configuration
> data"%h)
>
> I changed where you want matplotlib data stored """%h) into where you want
> matplotlib data stored """%(p,h)). However, I got the same error after
> changes. Did I do right?
Sorry, cutils.py is a part of a new config package we have been working on, 
which ships with matplotlib but is not activated. I think you need to edit 
your matplotlib/__init__.py instead, just make the same changes.
Once that change is made, and you try to import pylab, you should get a 
RunTimeError telling you that matplotlib can't create the directory, either 
because the path doesnt exist, or it exists but you cant write to it. At that 
point you can set your MPLCONFIGDIR environment variable to point somewhere 
writeable, and if it seems like a bug that matplotlib is trying to create a 
directory somewhere nonsensical, please let us know.
> I install matplotlib by:
> python setup.py build
> python setup.py install
> How can I install it by svn trunk?
The following should be on one line:
----
svn co 
https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/trunk/matplotlib 
matplotlib
----
then cd into the new directory and install in the usual way.
Darren
From: Matthias M. <Mat...@gm...> - 2008年03月25日 12:04:47
Hello Amit,
On Sunday 23 March 2008 09:54, Amit Finkler wrote:
> Hi everyone,
>
>
> I am using matplotlib to dynamically plot a graph with both my x and y
> points taken from a measurement device. That is to say, in each
> iteration of my while loop I'm reading two variables which I then want
> to plot with matplotlib.
>
>
> I wrote something which goes like this (disregard the Gnuplot - that's
> what I'm trying to replace with matplotlib...)
>
>
>
> import gpib, Numeric, time, Gnuplot, mymodule, threading
> from pylab import *
>
>
>
> def cooldown(filename, dmm_gpib, lake_gpib):
>
> """this program scans dummy and reads HP and Lakeshore"""
>
> A = Numeric.arange(-1, 1, .1)
> delay = 1
> f = open(filename,'w')
>
>
> X = []
> Y = []
> figure(2)
> hold(False)
> try:
> while A[0]<10:
>
> gpib.write(lake_fd, 'SDAT?')
> gpib.write(hp_fd, 'read?')
> time.sleep(delay)
> val1 = float(gpib.read(lake_fd, 30))
> val2 = float(gpib.read(hp_fd, 30))
> X.append(val1)
> Y.append(val2)
> plot(X,Y,'.-')
> f.write(str(val1) + '\t' + str(val2) + '\n')
> f.flush()
>
> I'm running this code in ipython with the -pylab option, so I don't need
> to use show(). My question is, how do I maintain a *constant* xlabel and
> ylabel without having to redraw them each time I append a point to the
> graph? If I try xlabel('something') then obviously it's cleared each
> time I use plot(X,Y).
I'm not sure I understand well, but if one uses xlabel("something") before the 
while-loop or just after building the figure, it is not redrawn after 
plotting.
regards
Matthias
From: Matthias M. <Mat...@gm...> - 2008年03月25日 10:32:07
Hey Chris,
On Saturday 22 March 2008 03:36, Chris Withers wrote:
> Matthias Michler wrote:
> > maybe something like the following helps you:
> > -------------------------------------------------------------------------
> >---------------- from pylab import *
> > from time import sleep
> >
> > ion() # interactive mode 'on'
> > figure()
> > ax = subplot(111, autoscale_on=True)
> >
> > x, y = [0], [0]
> > line = plot(x, y, label="my_data")[0]
> > # get the line-object as the first
> > element # of the tuple returned by plot legend()
> > for i in arange(10):
> > x.append(i) # append new values
> > y.append(i**2)
> > line.set_data(x,y) # reset data
> > ax.relim() # reset axes limits
> > ax.autoscale_view() # rescale axes
> > draw() # redraw current figure
> > sleep(0.5) # wait 0.5 seconds
> >
> > ioff()
>
> This is perfect, except for one little thing...
>
> My x-axis is time, and as new points are plotted, even though I'm
> following the above recipe pretty closely, the x-tick spacing isn't
> getting sorted out, so I end up with just a jumble as the tick labels
> for the x-axis. Do you know why this might be?
I'm not sure I understand correctly, but if the number of xticks increases 
dramatically (nobody could see the individual ticks), the above script leads 
to a different behaviour on my system.
> > I don't know how to make this somehow interactive concerning the data
> > input. but maybe you save the data to a file and read them every 15 or 20
> > minutes.
>
> This isn't a problem, I just run in a "while True" loop and leave it
> running until I close the plot window.
>
> Shame I get that horrible exception when I do close the plot window,
> wish I knew how to make it stop :-S
I don't know which exception you refer to, but sometimes if gives problems if 
the interactive mode wasn't switched off ("ioff()") before the scripts ends 
or "show()" is called.
regards
Matthias
From: Mark B. <ma...@gm...> - 2008年03月25日 08:38:47
Thanks to Fred, Chris, and JV for reproducing this bug.
We all get the same eps file, that doesn't show the greek symbols produced
with mathtext.
And we all do get correct results on the screen (using Tk) and in pdf and
png files.
It seems not to work on windows, while it used to work on versions
0.90.1and earlier.
Sorry for the bad news.
Anybody know how to fix this?
Thanks, Mark
On Sun, Mar 23, 2008 at 5:02 PM, Mark Bakker <ma...@gm...> wrote:
> Hello windows users -
>
> Can anybody using mpl 0.91.2 on windows reproduce this bug:
>
> from pylab import *
> plot([1,2,3])
> xlabel(r'$\chi$')
> savefig('c:/temp/test.eps')
>
> This should give an eps file that when viewed does not show the letter chi
> along the x-axis (that's the bug).
>
> We have been discussing this problem, and I think it is a bug in the
> windows distribution.
> (It worked on all the previous mpl versions fine, just when upgrading from
> 0.90.1 the problem arose).
>
> If you can, please email me your eps file: ma...@gm...
>
> Thanks for your help, Mark
>
From: Andrew C. <ac...@gm...> - 2008年03月25日 06:39:12
On Tue, Mar 25, 2008 at 4:45 AM, Christopher Barker
<Chr...@no...> wrote:
> > Processing dependencies for matplotlib==0.91.2
> > Searching for matplotlib==0.91.2
>
> But now it has determined that it has mpl 0.91.2 as a dependency, which
> is just plain odd -- I really don't get setuptools!
Me neither - but I just went with it.
> > Processing matplotlib-0.91.2.tar.gz
>
> so it has downloaded the tarball, and is trying to build it.
>
>
> > wxPython: no
> > * wxPython not found
>
> By the way I thought wxPython was only a run-time dependency now?
It installed ok without WX, though i've since reinstalled with WX.
> > In file included from /usr/X11/include/freetype2/freetype/freetype.h:41,
>
> some freetype warnings -- should it work with Apple-supplied freetype?
> it didn't used to , but it looks like these are only warnings now.
I've not yet tried to do anything clever with Tex or fonts, but it
seems to be working linked against the Apple supplied freetype.
> > ld: in /sw/lib/libJPEG.dylib, file is not of required architecture for
> > architecture ppc
>
> Now we've got a problem with a fink (or is it darwinports?) libJPEG,
> 'cause it's not Universal -- but why is it finding that libjpeg?
Yes, the issue was with the fink libraries. Not sure why it was
picking those up first - might be the way my path is set up. It's
working now though - removing the fink libraries worked well enough.
> 3) Maybe we should just distribute a binary *.mpkg instead. I've seen
> talk of a way to install a single binary that could work with either
> Apple's or MacPython's 2.5 -- I think it involved a symlink to a shared
> place to put packages -- anyone know if that actually works?
Sounds like a plan. Now that i have the use of this Mac I want to get
my research supervisor to install the whole kit of software that I
use, and the process so far has been moderately more trying than it
should be.
-------------------------
Centre for Australian Weather and Climate,
Australian Bureau of Meteorology.
Condensed Matter Theory Group,
RMIT University.
From: Albert C. i A. <al...@na...> - 2008年03月24日 23:15:12
Attachments: backtrace.txt
Hi,
I'm working on a Qt/KDE based GUI for TinyERP called, KTiny. One of the users 
has been trying the application on Mac and matplotlib crashes with the 
attached backtrace. Backend is Qt4Agg.
Unfortunately I don't have access to a Mac machine, but could ask him to try 
some things as he is very responsive. Has anyone an idea of what could be the 
problem? The application works perfectly well on Linux. On Windows is 
producing a segmentation fault, but that is an issue for another e-mail I 
think.
Any ideas will be very welcomed. Thanks in advance!
-- 
Albert Cervera i Areny
http://www.NaN-tic.com
From: Kenneth M. <xke...@gm...> - 2008年03月24日 21:21:21
Does anyone know how to change the polar graph so that i can graph 
with 0 at North, 90 at west, 180 at south and 270 at east? 
(Considering you look at the polar graph like a compass)
Thanks!
Kenneth Miller
From: Leonard J R. <re...@jp...> - 2008年03月24日 21:18:51
Hello,
What follows is the lasso example code that I am running. This is the 
example the comes with the matplotlib examples code. It works fine 
except when one clicks and does not move the mouse. It seems to hang.
I have traced it down to the self.canvas.widgetlock.locked() call within 
the LassoManager method called onpress. The onpress method is 
registered as a callback for a button press event. What I need to know 
is how to determine which widget has the lock and how to release the 
lock before returning from the callback so that everything will continue 
to work.
If anyone knows how to fix this please send example code.
Thanks,
Len
#!/usr/local/bin/python
"""
Simple hacked test case to add fake runs and print out selected point set.
Show how to use a lasso to select a set of points and get the indices
of the selected points. A callback is used to change the color of the
selected points
This is currently a proof-of-concept implementation (though it is
usable as is). There will be some refinement of the API and the
inside polygon detection routine.
"""
from matplotlib import widgets
import matplotlib.mlab
from matplotlib import nxutils
from matplotlib import colors
from matplotlib import collections
from matplotlib import pyplot
import numpy
from numpy.random import rand
class Datum:
 colorin = colors.colorConverter.to_rgba('red')
 colorout = colors.colorConverter.to_rgba('green')
 def __init__(self, x, y, run=None, include=False):
 self.x = x
 self.y = y
 self.run = run
 if include:
 self.color = self.colorin
 else:
 self.color = self.colorout
class LassoManager:
 def __init__(self, ax, data):
 self.axes = ax
 self.canvas = ax.figure.canvas
 self.data = data
 self.Nxy = len(data)
 self.facecolors = [d.color for d in data]
 self.xys = [(d.x, d.y) for d in data]
 self.facecolors[50] = (0.0,0.0,0.0,1.0)
 self.collection = collections.RegularPolyCollection(
 fig.dpi, 6, sizes=(100,),
 facecolors=self.facecolors,
 offsets = self.xys,
 transOffset = ax.transData)
 ax.add_collection(self.collection)
 self.cid = self.canvas.mpl_connect('button_press_event', 
self.onpress)
 def callback(self, verts):
 ind = numpy.nonzero(nxutils.points_inside_poly(self.xys, verts))[0]
 print "New selection:"
 for i in range(self.Nxy):
 if i in ind:
 self.facecolors[i] = Datum.colorin
 print "Index=%d, run=%d, xy = (%f,%f)" % 
(i,self.data[i].run,self.data[i].x,self.data[i].y)
 else:
 self.facecolors[i] = Datum.colorout
 self.canvas.draw_idle()
 self.canvas.widgetlock.release(self.lasso)
 del self.lasso
 def onpress(self, event):
 print "OK1"
 print self.canvas.widgetlock.locked()
 if self.canvas.widgetlock.locked():
 return
 print "OK2"
 if event.inaxes is None:
 return
 print "OK3"
 self.lasso = widgets.Lasso(event.inaxes, (event.xdata, 
event.ydata), self.callback)
 # acquire a lock on the widget drawing
 self.canvas.widgetlock(self.lasso)
 print "OK4"
data = [Datum(*xy) for xy in rand(100, 2)]
# Fake run data
i = 0
for d in data:
 d.run = i
 i += 1
fig = pyplot.figure()
ax = fig.add_subplot(111, xlim=(0,1), ylim=(0,1), autoscale_on=False)
lman = LassoManager(ax, data)
pyplot.show()
-- 
__________________________________________________
Leonard J. Reder
Jet Propulsion Laboratory
Email: re...@jp...
Phone (Voice): 818-354-3639
--------------------------------------------------
From: Charlie M. <cw...@gm...> - 2008年03月24日 19:48:42
On Mon, Mar 24, 2008 at 10:01 AM, Zachary Pincus <zac...@ya...>
wrote:
> > Zachary Pincus wrote:
> >
> >>> Can you tell me where you specified the -Os option to gcc to escape
> >>> the problem?
> >>
> >> So the compile that command that failed is printed right above the
> >> error message it generated. (The long line that starts with
> >> 'gcc' ...). I just copied this command, edited the -O3 to an -Os, and
> >> pasted that command-line back into the terminal. Total low-tech hack,
> >> as I didn't want to much with the setup.py file to fix compile flags
> >> on a per-file basis.
> >>
> >> After that file is compiled manually, you can re-run 'python setup.py
> >> build', and it will start up at the next step after the error.
> >>
> >> I got the same error in another step, which was a bit trickier to
> >> fix,
> >> because for some reason, src/_image.cpp gets copied to src/image.cpp
> >> on a temporary basis, and then compiled. (I presume the file isn't
> >> also modified?) But after the compile errors out, the copy is
> >> deleted,
> >> so just pasting in the offending gcc command doesn't work. So I had
> >> to
> >> manually copy src/_image.cpp to scr/image.cpp, and then paste in the
> >> modified gcc command.
> >>
> >> Ugh! I'd really love some help reducing this to a test case that I
> >> can
> >> send to Apple.
> >
> > I've got the same error(s) in the same situation (10.5.2). I haven't
> > seen it any other context nor have had any success in reducing to a
> > test
> > case, alas. Could this have to do with picking up libraries (from fink
> > or elsewhere) and/or different compiler versions? I've got XCode 3 and
> > gcc 4.0. (I've actually got the apple 4.2 preview release as well but
> > that craps out even earlier, I assume due to library version
> > mismatches...)
>
> I'm pretty sure what I'm seeing isn't from Fink or other library
> versions -- this was on a pretty clean 10.5 install. I'm using a
> custom-built Python 2.5.2 instead of Apple's, so that required
> installing a new version of readline, but other than that, the system
> is plain vanilla.
>
> Has nobody else built matplotlib from source on 10.5.2 lately?
>
I tried it after seeing your message. Indeed I got the same internal gcc
failure. This is a compiler problem the with the gcc on 10.5.2 (and
10.5.1I think). I found the same error message on many google hits
outside of
matplotlib. Your suggestion of compiling with -Os for the two problem files
worked fine for me.
- Charlie
From: Charlie M. <cw...@gm...> - 2008年03月24日 19:44:31
>
> 3) Maybe we should just distribute a binary *.mpkg instead. I've seen
> talk of a way to install a single binary that could work with either
> Apple's or MacPython's 2.5 -- I think it involved a symlink to a shared
> place to put packages -- anyone know if that actually works?
>
I agree on the mpkg, but the last few times I have tried bdist_mpkg it has
died miserably on mpl.
- Charlie
From: Brook L. <gnu...@ya...> - 2008年03月24日 17:52:29
After installation, I only ran a simple code attached below. I found that I
got this run time error from "from pylab import *".
I did go through what Mark Hamilton posted:
Index: cutils.py
===================================================================
--- cutils.py (revision 5001)
+++ cutils.py (working copy)
@@ -79,7 +79,7 @@
 raise RuntimeError("""\
 '%s' is not a writable dir; you must set %s/.matplotlib to be a writable
dir.
 You can also set environment variable MPLCONFIGDIR to any writable
directory
-where you want matplotlib data stored """%h)
+where you want matplotlib data stored """%(p,h))
 else:
 if not is_writable_dir(h):
 raise RuntimeError("Failed to create %s/.matplotlib; consider
setting MPLCONFIGDIR to a writable directory for matplotlib configuration
data"%h) 
I changed where you want matplotlib data stored """%h) into where you want
matplotlib data stored """%(p,h)). However, I got the same error after
changes. Did I do right? 
I install matplotlib by:
python setup.py build
python setup.py install
How can I install it by svn trunk?
Appreciated,
Brook
=============
from pylab import *
from matplotlib import *
from pylab import figure, close, show, nx
from matplotlib.figure import Figure
import time
x=arange(10)
y=[2, 4, 6, 8, 10, 12, 14, 16, 18, 20]
x2=arange(20)
y2=arange(20)
f=figure() 
hold(True)
plot(x,y)
plot(x2,y2)
grid()
pylab.show()
time.sleep(3)
pylab.close(f)
===================
-- 
View this message in context: http://www.nabble.com/Runtime-Error-tp16239554p16257231.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Christopher B. <Chr...@no...> - 2008年03月24日 17:42:05
Andrew Charles wrote:
> Yes it was the matplotlib-0.91.2-py2.5-macosx-10.3-fat.egg I tried to
> install. I've posted the entire easy_install output below.
Thanks. First, a note:
There is confusion here. If I have it right, the OP is trying to install 
the BINARY egg that is up on sourceforge into the MacPython/Python.org 
Python2.5 running on OS-X 10.5. This should work. However:
> Processing matplotlib-0.91.2-py2.5-macosx-10.3-fat.egg
...
> Installed /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib-0.91.2-py2.5-macosx-10.3-fat.egg
So this looks like it has installed the binary egg.
> Processing dependencies for matplotlib==0.91.2
> Searching for matplotlib==0.91.2
But now it has determined that it has mpl 0.91.2 as a dependency, which 
is just plain odd -- I really don't get setuptools!
> Processing matplotlib-0.91.2.tar.gz
so it has downloaded the tarball, and is trying to build it.
> wxPython: no
> * wxPython not found
By the way I thought wxPython was only a run-time dependency now?
> In file included from /usr/X11/include/freetype2/freetype/freetype.h:41,
some freetype warnings -- should it work with Apple-supplied freetype? 
it didn't used to , but it looks like these are only warnings now.
> ld: in /sw/lib/libJPEG.dylib, file is not of required architecture for
> architecture ppc
Now we've got a problem with a fink (or is it darwinports?) libJPEG, 
'cause it's not Universal -- but why is it finding that libjpeg?
So:
1) Have you tried aborting when it starts downloading? Maybe the binary 
is installed?
2) Why is it trying to download and build from source? Does anyone get 
setuptools enough to know?
3) Maybe we should just distribute a binary *.mpkg instead. I've seen 
talk of a way to install a single binary that could work with either 
Apple's or MacPython's 2.5 -- I think it involved a symlink to a shared 
place to put packages -- anyone know if that actually works?
-Chris
-- 
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chr...@no...
From: Ryan D. <rya...@UD...> - 2008年03月24日 15:19:32
I got the example working (svn diff below). Should Collection objects 
have a set_offsets method?
-Ryan
Index: dynamic_collection.py
===================================================================
--- dynamic_collection.py (revision 5020)
+++ dynamic_collection.py (working copy)
@@ -34,6 +34,8 @@
 color = cm.jet(rand())
 offsets.append((x,y))
 facecolors.append(color)
+ collection._offsets = offsets
+ collection.set_facecolors(facecolors)
 fig.canvas.draw()
 elif event.key=='d':
 N = len(offsets)
@@ -41,6 +43,8 @@
 ind = random.randint(0,N-1)
 offsets.pop(ind)
 facecolors.pop(ind)
+ collection._offsets = offsets
+ collection.set_facecolors(facecolors)
 fig.canvas.draw()
 fig.canvas.mpl_connect('key_press_event', onpress)
> Hi,
> I tried to run the dynamic_collections.py example in the source
> directory (SVN revision 5002) but got the following error:
> 
> Traceback (most recent call last):
> File "dynamic_collection.py", line 23, in <module>
> transOffset = ax.transData,
> TypeError: __init__() got multiple values for keyword argument 'numsides'
> 
> I removed the numsides=5 keyword argument (line 16) from
> dynamic_collections.py, and while it lets the example run without error,
> the "dynamic" aspect doesn't work. That is, the initial plot with a
> single point appears but pressing 'a' or 'd' does nothing (when it
> should add or delete a point).
> 
> Any ideas on how to get this working?
> 
> thanks,
> -Ryan 
From: Alex C. <thr...@MI...> - 2008年03月24日 14:17:54
> I believe I have fixed the problem in the latest svn versions, both on
> the maintenance branch and on the trunk. Please try the latest version
Thanks for your help, Jouni. That seems to have fixed the problem.
Best,
Alex
From: Zachary P. <zac...@ya...> - 2008年03月24日 14:01:54
> Zachary Pincus wrote:
>
>>> Can you tell me where you specified the -Os option to gcc to escape
>>> the problem?
>>
>> So the compile that command that failed is printed right above the
>> error message it generated. (The long line that starts with
>> 'gcc' ...). I just copied this command, edited the -O3 to an -Os, and
>> pasted that command-line back into the terminal. Total low-tech hack,
>> as I didn't want to much with the setup.py file to fix compile flags
>> on a per-file basis.
>>
>> After that file is compiled manually, you can re-run 'python setup.py
>> build', and it will start up at the next step after the error.
>>
>> I got the same error in another step, which was a bit trickier to 
>> fix,
>> because for some reason, src/_image.cpp gets copied to src/image.cpp
>> on a temporary basis, and then compiled. (I presume the file isn't
>> also modified?) But after the compile errors out, the copy is 
>> deleted,
>> so just pasting in the offending gcc command doesn't work. So I had 
>> to
>> manually copy src/_image.cpp to scr/image.cpp, and then paste in the
>> modified gcc command.
>>
>> Ugh! I'd really love some help reducing this to a test case that I 
>> can
>> send to Apple.
>
> I've got the same error(s) in the same situation (10.5.2). I haven't
> seen it any other context nor have had any success in reducing to a 
> test
> case, alas. Could this have to do with picking up libraries (from fink
> or elsewhere) and/or different compiler versions? I've got XCode 3 and
> gcc 4.0. (I've actually got the apple 4.2 preview release as well but
> that craps out even earlier, I assume due to library version 
> mismatches...)
I'm pretty sure what I'm seeing isn't from Fink or other library 
versions -- this was on a pretty clean 10.5 install. I'm using a 
custom-built Python 2.5.2 instead of Apple's, so that required 
installing a new version of readline, but other than that, the system 
is plain vanilla.
Has nobody else built matplotlib from source on 10.5.2 lately?
Zach
>
>>
>> Zach
>>
>>
>> On Mar 13, 2008, at 12:16 PM, Stephane Raynaud wrote:
>>
>>> Hi,
>>>
>>> I got the same problem.
>>> Can you tell me where you specified the -Os option to gcc to escape
>>> the problem?
>>>
>>>
>>> On Mon, Mar 10, 2008 at 4:35 AM, Zachary Pincus <zac...@pu...
>>>> wrote:
>>>> Hello,
>>>>
>>>> I just tried to compile the SVN head of matplotlib (r4994) from
>>>> source
>>>> on OS X 10.5.2 (with source builds of python 2.5.2 and the SVN head
>>>> of
>>>> numpy), and ran into an "internal compiler error" in the agg code.
>>>> (pkgconfig 0.23 and wxPython 2.8.7.1 also present and accounted 
>>>> for.)
>>>>
>>>> Here's the compile line and error:
>>>>> building 'matplotlib.backends._backend_agg' extension
>>>>> gcc -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-
>>>>> fused-
>>>>> madd -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-
>>>>> prototypes -I/Library/Frameworks/Python.framework/Versions/2.5/ 
>>>>> lib/
>>>>> python2.5/site-packages/numpy/core/include -I/usr/X11/include/
>>>>> libpng12 -I/usr/local/include -I/usr/include -I/usr/X11R6/ 
>>>>> include -
>>>>> I. -I/Library/Frameworks/Python.framework/Versions/2.5/lib/
>>>>> python2.5/
>>>>> site-packages/numpy/core/include -Isrc -Iagg24/include -I. -I/usr/
>>>>> X11/include/freetype2 -I/usr/X11/include -I/usr/local/include -I/
>>>>> usr/
>>>>> include -I/usr/X11R6/include -I. -I/Library/Frameworks/
>>>>> Python.framework/Versions/2.5/include/python2.5 -c src/ 
>>>>> _image.cpp -o
>>>>> build/temp.macosx-10.4-i386-2.5/src/_image.o
>>>>> cc1plus: warning: command line option "-Wstrict-prototypes" is 
>>>>> valid
>>>>> for C/ObjC but not for C++
>>>>> src/_image.cpp: In member function 'Py::Object
>>>>> _image_module::from_images(const Py::Tuple&)':
>>>>> src/_image.cpp:842: error: insn does not satisfy its constraints:
>>>>> (insn 2573 1070 2574 126 agg24/include/agg_color_rgba.h:268 (set
>>>>> (mem:QI (plus:SI (reg/f:SI 6 bp)
>>>>> (const_int -280 [0xfffffffffffffee8])) [0 SR.2969+0
>>>>> S1 A8])
>>>>> (reg:QI 5 di)) 56 {*movqi_1} (nil)
>>>>> (nil))
>>>>> src/_image.cpp:842: internal compiler error: in
>>>>> reload_cse_simplify_operands, at postreload.c:391
>>>>> Please submit a full bug report, with preprocessed source if
>>>>> appropriate.
>>>>> See <URL:http://developer.apple.com/bugreporter> for instructions.
>>>> This seems to be an agg and OS X error; it's cropped up here:
>>>> http://trac.osgeo.org/mapserver/ticket/2368
>>>> and John Hunter reported it on the agg list here:
>>>> http://article.gmane.org/gmane.comp.graphics.agg/3963
>>>>
>>>> Unfortunately, the error appears to either not have been fixed by 
>>>> the
>>>> 10.5.1 update, as suggested in the email thread cited above, or the
>>>> error re-appeared in 10.5.2.
>
>
> -------------------------------------------------------------------------
> 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: Chris W. <ch...@si...> - 2008年03月24日 13:52:54
Hi Brook,
Brook Lin wrote:
> raise RuntimeError("'%s' is not a writable dir; you must set
> %s/.matplotlib to be a writable dir. You can also set environment variable
> MPLCONFIGDIR to any writable directory where you want matplotlib data stored
> "%h)
This is the crucial bit.
Looks like you've set MPLCONFIGDIR to a read-only dir, or the 
.matplotlib in the current dir or .matplotlib in your home directory 
aren't writeable by the user running your python script. (I'm doing a 
bit of guesswork here...)
What is it that you're trying to do?
cheers,
Chris
-- 
Simplistix - Content Management, Zope & Python Consulting
 - http://www.simplistix.co.uk
From: Michael D. <md...@st...> - 2008年03月24日 12:04:09
Simson Garfinkel wrote:
> 1. Moving to matplotlib-0.91.2 solved the problem with PDF generation 
> on log axes.
>
> 2. Installing matplotlib-0.91.2 on Linux required installing these 
> packages first:
> 	* freetype-devel
> 	* libpng-devel
>
> (Those packages were NOT installed automatically by easy_install)
> 
Yeah -- easy_install doesn't address installing anything that's non-Python. It's a source of ranging debate about easy_install vs. the distribution packaging systems.
Mike
-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
From: John H. <jd...@gm...> - 2008年03月24日 02:34:36
On Sun, Mar 23, 2008 at 8:51 PM, Darren Dale <dar...@co...> wrote:
> > raise RuntimeError("'%s' is not a writable dir; you must set
> > %s/.matplotlib to be a writable dir. You can also set environment variable
> > MPLCONFIGDIR to any writable directory where you want matplotlib data
> > stored "%h)
> > TypeError: not enough arguments for format string
> >
> > How can I get it fixed?
>
> We might be in a better position to help if you post the example code.
This bug was first pointed out by Mark Hamilton (with a patch) in the
thread "RuntimeError in _get_configdir". I've committed his fix to
svn. Basically, the format string is looking for two arguments where
only one is provided. Because it only arises in an error condition,
it is a corner of the code that had not been hit before.
JDH
From: Darren D. <dar...@co...> - 2008年03月24日 01:51:46
On Sunday 23 March 2008 2:23:36 pm Brook Lin wrote:
> Hi All,
>
> I installed the matplotlib0.91.2 on 64-bit Ubuntu7.04 system. I ran an
> example code and got the error:
>
> File "testplot.py", line 2, in <module>
> from pylab import *
> File "/usr/lib/python2.5/site-packages/pylab.py", line 1, in <module>
> from matplotlib.pylab import *
> File "/usr/lib/python2.5/site-packages/matplotlib/__init__.py", line 639,
> in <module>
> rcParams = rc_params()
> File "/usr/lib/python2.5/site-packages/matplotlib/__init__.py", line 562,
> in rc_params
> fname = matplotlib_fname()
> File "/usr/lib/python2.5/site-packages/matplotlib/__init__.py", line 513,
> in matplotlib_fname
> fname = os.path.join(get_configdir(), 'matplotlibrc')
> File "/usr/lib/python2.5/site-packages/matplotlib/__init__.py", line 207,
> in wrapper
> ret = func(*args, **kwargs)
> File "/usr/lib/python2.5/site-packages/matplotlib/__init__.py", line 400,
> in _get_configdir
> raise RuntimeError("'%s' is not a writable dir; you must set
> %s/.matplotlib to be a writable dir. You can also set environment variable
> MPLCONFIGDIR to any writable directory where you want matplotlib data
> stored "%h)
> TypeError: not enough arguments for format string
>
> How can I get it fixed?
We might be in a better position to help if you post the example code.
From: Andrew C. <ac...@gm...> - 2008年03月24日 01:23:16
I had a similar issue trying to install the matplotlib egg on Leopard
- same setup with the seperate macpython install. I solved the issue
by removing the fink versions of libJPEG and libTIFF. From the output
you've posted it looks as though you're install is failing at the same
point, on the macports libJPEG in /opt/local/lib.
I just removed the fink tiff and jpeg libraries and this fixed the
problem, although I can't guarantee this won't break other apps you've
installed that use these libraries. There may be a way to force it to
link to the system default libTIFF and libJPEG, but I don't know it.
Andrew
On Sat, Mar 1, 2008 at 9:39 AM, Christopher Barker
<Chr...@no...> wrote:
> Samuel M. Smith wrote:
> > I finally bit the bullet and decided to upgrade to Leopard.
> > The MatPlotLib 0.91.2 egg fails to install.
> >
> >
> > Configuration:
> > MacBook Pro
> > OS X 10.5.2
> >
> > Python 2.5.2 from http://www.pythonmac.org/packages/py25-fat/dmg/
> > python-2.5-macosx.dmg
>
>
> > 0.9.1.2 egg from http://downloads.sourceforge.net/matplotlib/
> > matplotlib-0.91.2-py2.5-macosx-10.3-fat.egg?
> > modtime=1200067054&big_mirror=0
>
> This works fine for me on OS-X 10.4 (other stuff the same as you)
>
>
> > When I use easy_install on the egg I get a bunch of errors and the
> > install fails.
>
> Are you sure you're using the easy_install for the MacPython you
> installed, rather than the one that installs into Apple's Python? Try:
>
> $ which easy_install
>
> I get:
> /Library/Frameworks/Python.framework/Versions/Current/bin/easy_install
>
>
> > What's the recommended approach for installing on 10.5?
>
> It seems most folks are using the Apple-supplied Python2.5, rather than
> the MacPython one -- you might want to try that.
>
>
> > Processing matplotlib-0.91.2-py2.5-macosx-10.3-fat.egg
> > Copying matplotlib-0.91.2-py2.5-macosx-10.3-fat.egg to /Library/
> > Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages
>
> hmmm -- that looks right.
>
>
> > Processing dependencies for matplotlib==0.91.2
> > Searching for matplotlib==0.91.2
> > Reading http://pypi.python.org/simple/matplotlib/
> > Reading http://matplotlib.sourceforge.net
> > Reading http://sourceforge.net/project/showfiles.php?
> > group_id=80706&package_id=82474
> > Reading http://sourceforge.net/project/showfiles.php?group_id=80706
> > Best match: matplotlib 0.91.2
> > Downloading http://downloads.sourceforge.net/matplotlib/
> > matplotlib-0.91.2.tar.gz?modtime=1199627250&big_mirror=0
> > Processing matplotlib-0.91.2.tar.gz
>
> here's your problem -- it isn't recognizing the egg as one that will
> work on 10.5, so it's downloading the tarball to try to build a new one
> for you -- that's apparently failing.
>
> Someone did some trickery that is beyond me for the 0.91.1 egg, so that
> it was recognized as being acceptable on 10.4 and 10.5. You might search
> this list for discussion of that.
>
> eggs sure seem like a good idea, but this does get messy!
>
> By the way, on my system (10.4), the binary egg on sourceforge installed
> fine, but easy_install didn't fine it for me -- should it be able to do
> that?
>
> -Chris
>
>
>
> --
> Christopher Barker, Ph.D.
> Oceanographer
>
> Emergency Response Division
> NOAA/NOS/OR&R (206) 526-6959 voice
> 7600 Sand Point Way NE (206) 526-6329 fax
> Seattle, WA 98115 (206) 526-6317 main reception
>
> Chr...@no...
>
>
>
> -------------------------------------------------------------------------
> 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: Simson G. <si...@ac...> - 2008年03月23日 19:52:08
Ah, if you are using /sw/, then you are using fink.
I pretty much gave up on fink a while ago and now use macports; if I 
can't install with macports, I install with source.
The reason that I gave up with fink is that it's largely a Linux- 
heritage thing, while macports is a BSD-heritage thing. MacOS is 
FreeBSD, not Linux.
YMMV
On Mar 23, 2008, at 3:53 AM, Andrew Charles wrote:
> I'm happy to report that the egg install is now working. Still not
> able to get the source to compile but I can live with that.
>
> The problem appears to be the fink versions of libJPEG and libTIFF.
> When I removed /sw/libJPEG, the installation crashed with a similar
> error on libTIFF. When I removed /sw/libTIFF (fink remove libTIFF)
> the egg install (sudo easy_install
> matplotlib-0.91.2-py2.5-macosx-10.3-fat.egg) worked.
>
> The last thing I had to do was change the ownership and permissions of
> my ~/ .matplotlib from root to me, and simple plot commands are now
> working.
>
> Now, some people may need their fink /sw versions of libJPEG and
> libTIFF - are there commands that you can pass to easy_install to
> instruct it to link against the default installed libJPEG and
> libTIFFs?
>
> Cheers,
>
> Andrew
>
> -------------------------------------------------------------------------
> 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: Wayne E. H. <wh...@pa...> - 2008年03月23日 19:01:54
It was about a problem with legend ordering when using twinx().
Wayne
From: Tiago R. <wo...@gm...> - 2008年03月23日 18:53:54
Thanks Jeff, I indeed had used the egg. Will try doing a standar 
install.
Tiago
On Mar 23, 2008, at 8:00 AM, Jeff Whitaker wrote:
> Tiago Ribeiro wrote:
>> Hi,
>>
>> I'm running a vanilla copy of Mac OS X 10.5.2 and just installed 
>> matplotlib-0.91.2, geos-2.2.3 and baselib-0.9.9.1 from their 
>> sources. The matplotlib examples work fine, but when trying to 
>> import baselib, it says it cannot find it:
>>
>> >>> from matplotlib.toolkits.basemap import Basemap
>> Traceback (most recent call last):
>> File "<stdin>", line 1, in <module>
>> ImportError: No module named basemap
>> >>>
>>
>> Any idea of what could be happening? The lib is definitively on my 
>> path (/Library/Python/2.5/site-packages/)
>>
>> Best,
>>
>> Tiago
>>
>>
>>
> Tiago: This will happen if matplotlib is installed as an egg, due 
> to a bug in the way toolkits are installed. Do you see a 
> matplotlib*egg file in /Library/Python/2.5/site-packages/ ?
>
> If so, all I can suggest is reinstalling matplotlib the 'normal' 
> way, i.e. python setup.py install. This bug is fixed in svn so this 
> won't happen with the next release.
>
> -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: Brook L. <gnu...@ya...> - 2008年03月23日 18:23:42
Hi All,
I installed the matplotlib0.91.2 on 64-bit Ubuntu7.04 system. I ran an
example code and got the error:
 File "testplot.py", line 2, in <module>
 from pylab import *
 File "/usr/lib/python2.5/site-packages/pylab.py", line 1, in <module>
 from matplotlib.pylab import *
 File "/usr/lib/python2.5/site-packages/matplotlib/__init__.py", line 639,
in <module>
 rcParams = rc_params()
 File "/usr/lib/python2.5/site-packages/matplotlib/__init__.py", line 562,
in rc_params
 fname = matplotlib_fname()
 File "/usr/lib/python2.5/site-packages/matplotlib/__init__.py", line 513,
in matplotlib_fname
 fname = os.path.join(get_configdir(), 'matplotlibrc')
 File "/usr/lib/python2.5/site-packages/matplotlib/__init__.py", line 207,
in wrapper
 ret = func(*args, **kwargs)
 File "/usr/lib/python2.5/site-packages/matplotlib/__init__.py", line 400,
in _get_configdir
 raise RuntimeError("'%s' is not a writable dir; you must set
%s/.matplotlib to be a writable dir. You can also set environment variable
MPLCONFIGDIR to any writable directory where you want matplotlib data stored
"%h)
TypeError: not enough arguments for format string
How can I get it fixed?
Thanks,
Brook
-- 
View this message in context: http://www.nabble.com/Runtime-Error-tp16239554p16239554.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
4 messages has been excluded from this view by a project administrator.

Showing results of 450

<< < 1 .. 3 4 5 6 7 .. 18 > >> (Page 5 of 18)
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 によって変換されたページ (->オリジナル) /