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






Showing results of 523

<< < 1 2 3 4 5 .. 21 > >> (Page 3 of 21)
From: Zorg 4. <zor...@gm...> - 2009年05月28日 06:47:36
Hello matplotlib users,
Using the source tarball on sourceforge (0.98.5.3), having pyqt-4.4.4
working, pyobjc-2.2b2 too (for GUI), but no pygtk at all, pylab does
not work (a pylab based script simply display nothing, not even create
a window). Embedding in QT4 works fine.
even when using pythonw.
During build, everything went fine except for those two libraries, for
which some
dependencies were not fat binaries (both ppc and intel binaries). I've compiled
by hand using the following (the original compiler invocation had "-arch ppc" as
the first arg, it has been removed).
Not: I'm on OSX 10.5
Anyone with the same issue?
(note: it was working fine with python 2.5.2 from python.org)
g++ -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g -bundle
-undefined dynamic_lookup build/temp.macosx-10.3-fat-2.6/src/ft2font.o
build/temp.macosx-10.3-fat-2.6/src/mplutils.o
build/temp.macosx-10.3-fat-2.6/CXX/IndirectPythonInterface.o
build/temp.macosx-10.3-fat-2.6/CXX/cxx_extensions.o
build/temp.macosx-10.3-fat-2.6/CXX/cxxsupport.o
build/temp.macosx-10.3-fat-2.6/CXX/cxxextensions.o -L/opt/local/lib
-L/usr/local/lib -L/usr/lib -L/usr/X11R6/lib -lfreetype -lz -lz
-lstdc++ -lm -o build/lib.macosx-10.3-fat-2.6/matplotlib/ft2font.so
g++ -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g -bundle
-undefined dynamic_lookup build/temp.macosx-10.3-fat-2.6/src/_png.o
build/temp.macosx-10.3-fat-2.6/src/mplutils.o
build/temp.macosx-10.3-fat-2.6/CXX/IndirectPythonInterface.o
build/temp.macosx-10.3-fat-2.6/CXX/cxx_extensions.o
build/temp.macosx-10.3-fat-2.6/CXX/cxxsupport.o
build/temp.macosx-10.3-fat-2.6/CXX/cxxextensions.o -L/opt/local/lib
-L/usr/local/lib -L/usr/lib -L/usr/X11R6/lib -lpng12 -lz -lz -lstdc++
-lm -o build/lib.macosx-10.3-fat-2.6/matplotlib/_png.so
From: Eric F. <ef...@ha...> - 2009年05月28日 06:31:08
jinbo wang wrote:
> Hi dear users,
> Recently I found pcolor took tremendously longer to draw a figure 
> than contour or imshow. I am wondering if anyone had the same 
> experience, or anyone knows why? Thank you very much!
Yes, pcolor is inherently very slow, but flexible. Imshow is very fast, 
but restricted in some ways (rectangular grid), flexible in others (it 
has a ridiculous number of interpolation options). Contouring is a 
completely different sort of operation.
Pcolor is slow because it uses a patch collection, which is not very 
quick to render; imshow goes straight to C++ code for rendering, and 
because of the simplicity of the imshow input, that code can be highly 
optimized.
You might try substituting pcolormesh for pcolor. It is not quite a 
general and flexible, but it is much more highly optimized for rendering 
with Agg.
Eric
> Jinbo
> 
> ------------------------------------------------------------------------------
> Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT 
> is a gathering of tech-side developers & brand creativity professionals. Meet
> the minds behind Google Creative Lab, Visual Complexity, Processing, & 
> iPhoneDevCamp as they present alongside digital heavyweights like Barbarian 
> Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com 
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: jinbo w. <ji...@MI...> - 2009年05月28日 02:13:17
Hi dear users,
 Recently I found pcolor took tremendously longer to draw a figure 
than contour or imshow. I am wondering if anyone had the same 
experience, or anyone knows why? Thank you very much!
Jinbo
Hi Darren,
thanks for replying
On Wed, May 27, 2009 at 21:01, Darren Dale <dsd...@gm...> wrote:
> On Wed, May 27, 2009 at 9:11 AM, Sandro Tosi <mo...@de...> wrote:
>>
>> Hi all,
>> I'd like to adapt 'animation_blit_qt4.py' to a pure OO approach,
>> removing pylab from the code and move to something near to
>> 'embedding_in_qt4.py'.
>>
>> I tried a bit but failed miserably :(
>>
>> What I'd like to achieve is use something like in
>> 'embedding_in_qt4.py' but that can be updated using the timerEvent /
>> startTime paradigm (something similar to gobject.add_idle(func) but
>> this time for Qt4).
>>
>> Can someone please give me a help on this?
>
> Can you be more specific? Maybe post what you have along with a description
> of how it is failing?
Eheh, sorry for being so generic: I wrote that email from work, while
the code I've worked on was at home ;)
So, the situation is this:
- animation_blit_qt4.py has a nice way to update the graph "online",
using the timerEvent/startTimer
- animation_blit_qt4.py contains pylab staff (I want to avoid using)
- animation_blit_qt4.py uses the backend Qt4Agg not the backend object
- embedding_in_qt4.py uses an OO approach at embedding mpl in a qt4
widget/application.
The ultimate result I want to achieve is to embed mpl in a qt4
application but update the graph in realtime.
So I started modifying animation_blit_qt4.py to make it "more OO" :)
The attached script "animation_blit_qt4_morph.py" only replaced the
pylab parts with a mix of OO style and pyplot, and the timerEvent just
print the receive event without updating the graph.
As you can see, not much of what I need :(
What I'd like to achive is something similar to
"embedding_in_qt4_morph.py" but where the graph is updated
automatically like in an animation.
Your help will be appreciated a lot :)
Thanks,
-- 
Sandro Tosi (aka morph, morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi
From: Will G. <wg...@mi...> - 2009年05月27日 22:32:00
Hello Mike,
Thanks for the quick reply - I'll try "path.simplify" as you suggest.
My actual data is pretty big and unruly, but I wrote a bit of code
that demonstrates the point dropping. This code plots three
single-point-wide peaks on a baseline of noise that is 'length' points
long. For smaller values of 'length' all three points are visible,
but for larger values some or all of the points disappear. Maybe it's
unrealistic to think that all single-point outliers should always be
visible at any scale, but in this case these three points are
significantly different from all the baseline points and dropping them
obviously makes for a much different looking plot. My actual data
doesn't have single-point peaks like this, but it does have
~50-point-wide peaks in a ~1,000,000 point plot, and many of those
peaks are routinely shortened or eliminated in the zoomed-out plot of
my data, only to reappear when adequately zoomed-in.
Tell me if there's any thing else I can provide you with, or if this
is just the way things are when plotting big data sets. Thanks again,
 -- Will
###########
import numpy
import pylab
# When length = 2000, this usually plots all 3 peaks
# When length = 5000, this plots 3, 2, 1, or 0 peaks
length = 2000
x = numpy.arange(length)
y = numpy.random.normal(loc=0.0, scale=1.0, size=length)
y[int(length*0.4)] = 100.0
y[int(length*0.5)] = 100.0
y[int(length*0.6)] = 100.0
pylab.plot(x,y)
pylab.show()
###########
On Wed, May 27, 2009 at 6:32 AM, Michael Droettboom <md...@st...> wrote:
> You can set the rcParam "path.simplify" to False to turn off this behavior.
>
> However, the goal is that the simplification is not noticable -- if it is
> that may be a bug. Are you able to share your data so I can look into this
> further?
>
> Cheers,
> Mike
>
> Will Grover wrote:
>>
>> Hello matplotlib users,
>>
>> I'm using matplotlib to plot some large data sets (1 million x,y
>> pairs) and I've noticed that, when zoomed out to view the whole plot,
>> it looks as if only every Nth point is being plotted, maybe in an
>> attempt to improve plotting performance in complex plots. When I zoom
>> in I can see points that were clearly missing in the zoomed-out view.
>> Is there any way to override this so that the plot really does show
>> all the points, regardless of zoom? I've included my really simple
>> plotting code below, and I'm using the "scipy superpack" (python 2.5,
>> matplotlib-0.98.6) on an OS X 10.5.7 Mac.
>>
>> Many thanks for any help!
>>
>>  --Will
>>
>>
>>
>> import pylab
>> import smr
>> import sys
>> for freqs, stats, chronos in smr.loadData(sys.argv[1:]): # loads data
>> into numpy.arrays
>>    pylab.plot(chronos, freqs)
>>    pylab.show()
>>
>>
>> ------------------------------------------------------------------------------
>> Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT is a
>> gathering of tech-side developers & brand creativity professionals. Meet
>> the minds behind Google Creative Lab, Visual Complexity, Processing, &
>> iPhoneDevCamp as they present alongside digital heavyweights like Barbarian
>> Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com
>> _______________________________________________
>> 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
>
>
On Wed, May 27, 2009 at 9:11 AM, Sandro Tosi <mo...@de...> wrote:
> Hi all,
> I'd like to adapt 'animation_blit_qt4.py' to a pure OO approach,
> removing pylab from the code and move to something near to
> 'embedding_in_qt4.py'.
>
> I tried a bit but failed miserably :(
>
> What I'd like to achieve is use something like in
> 'embedding_in_qt4.py' but that can be updated using the timerEvent /
> startTime paradigm (something similar to gobject.add_idle(func) but
> this time for Qt4).
>
> Can someone please give me a help on this?
>
Can you be more specific? Maybe post what you have along with a description
of how it is failing?
Darren
From: Tony S Yu <to...@MI...> - 2009年05月27日 18:10:31
Correction, this error occurs on all GUI backends I've tried (I don't 
have gtk installed). The malloc error didn't occur on the other 
backends until I tried to interact with the plot window.
-T
On May 27, 2009, at 12:36 PM, Tony S Yu wrote:
> I'm running into a really bizarre error that seems to have started
> spontaneously (no changes I can think of were made to my system in the
> last few days and mpl was plotting without problems up until a few
> hours ago). When using WxAgg, the following code raises a malloc 
> error.
>
>>>> import matplotlib.pyplot as plt
>>>> plt.plot([0, 1])
>>>> plt.show()
>
> Python(477,0xa0710720) malloc: *** error for object 0x220068: Non-
> aligned pointer being freed
> *** set a breakpoint in malloc_error_break to debug
>
> This error only occurs on the Wx/WxAgg backends AND when show() is
> called; Qt4Agg, TkAgg, and MacOSX backends work fine.
>
> This error is also generated when starting ipython with the pylab flag
> (and WxAgg set as the default backend).
>
> Sorry I can't give more information about the error itself; I'm not
> sure how to in this case.
>
> Thanks in advance for your help,
> -Tony
>
> Mac OS X 10.5.7
> Python 2.5.1
> Matplotlib trunk r7142
> WX 2.8.4.0 (mac-unicode)
>
> ------------------------------------------------------------------------------
> Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
> is a gathering of tech-side developers & brand creativity 
> professionals. Meet
> the minds behind Google Creative Lab, Visual Complexity, Processing, &
> iPhoneDevCamp as they present alongside digital heavyweights like 
> Barbarian
> Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Michael D. <md...@st...> - 2009年05月27日 17:43:08
Good find. The comment is out of date. It is now followed in all 
backends. I will update the template.
Mike
Eric Firing wrote:
> Michael Droettboom wrote:
>> You can set the rcParam "path.simplify" to False to turn off this 
>> behavior.
>
> Mike,
>
> The matplotlibrc.template indicates that this is effective only for 
> vector backends; is the template comment incorrect?
>
> Eric
>
> #path.simplify : False # When True, simplify paths in vector 
> backends, such as
> # PDF, PS and SVG
> #path.simplify_threshold : 0.1 # The threshold of similarity below which
> # vertices will be removed in the 
> simplification
> # process
>
-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
From: Eric F. <ef...@ha...> - 2009年05月27日 17:40:08
Michael Droettboom wrote:
> You can set the rcParam "path.simplify" to False to turn off this behavior.
Mike,
The matplotlibrc.template indicates that this is effective only for 
vector backends; is the template comment incorrect?
Eric
#path.simplify : False # When True, simplify paths in vector backends, 
such as
 # PDF, PS and SVG
#path.simplify_threshold : 0.1 # The threshold of similarity below which
 # vertices will be removed in the 
simplification
 # process
From: Tony S Yu <to...@MI...> - 2009年05月27日 16:36:59
I'm running into a really bizarre error that seems to have started 
spontaneously (no changes I can think of were made to my system in the 
last few days and mpl was plotting without problems up until a few 
hours ago). When using WxAgg, the following code raises a malloc error.
 >>> import matplotlib.pyplot as plt
 >>> plt.plot([0, 1])
 >>> plt.show()
Python(477,0xa0710720) malloc: *** error for object 0x220068: Non- 
aligned pointer being freed
*** set a breakpoint in malloc_error_break to debug
This error only occurs on the Wx/WxAgg backends AND when show() is 
called; Qt4Agg, TkAgg, and MacOSX backends work fine.
This error is also generated when starting ipython with the pylab flag 
(and WxAgg set as the default backend).
Sorry I can't give more information about the error itself; I'm not 
sure how to in this case.
Thanks in advance for your help,
-Tony
Mac OS X 10.5.7
Python 2.5.1
Matplotlib trunk r7142
WX 2.8.4.0 (mac-unicode)
From: Christopher B. <Chr...@no...> - 2009年05月27日 16:27:05
Stefanie Lück wrote:
> I'm trying to print my plots in a wxScrolledPanel under Windows XP but 
> it dosen't work. I only can print / preview the start of the plot on the 
> left upper site, the rest of page is empty:
I wonder if that has to do with how you are using the scolledpanel, and 
DCs. Post a sample (as a as-small-as-possible-running-app, if you can), 
and we can take a look.
> I used printing according the example of matplotlib printing_in_wx.py.
> BTW if I want to run this demo, Python crashes.
it works fine for me on OS-X
What messages to you get with your crash? What versions of Python, 
wxPython and MPL are you running?
-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: Christopher B. <Chr...@no...> - 2009年05月27日 16:21:26
guillaume ranquet wrote:
> this is how I convert the xml into "plottable" arrays:
> 
> def getnamefrom(name,src,what):
> """extracts timestamps and 'what' from 'src' for 'name'"""
> buffwhat = []
> bufftime = []
> sortedbyname = []
> [sortedbyname.append(element) for
> element in src if
> element["name"] == name]
> for i in sortedbyname[:-1]:
> if i['name'] == name:
> bufftime.append(i["timestamp"]/1e9)
> buffwhat.append(i[what])
> return buffwhat,bufftime
> 
> x,y = getnamefrom("cpu0",cpustat,"usage")
> plt.plot(x,y)
> del cpustat
> 
> 
> (yes, it's a hardware monitor :D)
> basically, it seems cpustat is still refcounted somewhere.
what is cpustat? ans elementtree? Anyway, it sure looks like x and y 
should be full of copies of the data, so you don't have any references 
that would keep cpustat alive.
Also, it looks like x and y are lists -- when you pass those into MPL, 
they will be copied to numpy arrays, so you can delete them too, jsut in 
case they are keeping references to cpustat items.
 > I wonder if I should append(copy.copy(i[...])) instead?
rather than that, I'd copy to numpy arrays explicitly:
return np.array(buffwhat), np.array(bufftime)
That's what MPL uses internally anyway, and you'll be clear what you 
want. If you know how many items you'll have to begin with, you can put 
the data into np.arrays directly (np.arrays do not support appending).
> or If I'm mis-interpreting what I see with top.
you could be -- Python does not necessarily give memory back to the 
system when it's done with it -- but it should be able to re-use it.
 > I'm trying to get infos directly from the gc atm.
you could use sys.getrefcount() (note that it creates a reference 
itself, so it's always at least 2), but that may nothelp, as it may not 
be the elementree that has multiple references, but rather something 
inside it....This is very tricky business -- Python frees you from 
worrying about memory management almost all the time, but it does mean 
that you give up control.
-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: Ole S. <ole...@gm...> - 2009年05月27日 15:50:08
Hi,
I am using matplotlib for some data vizualization. To ensure a
consistent user interface among the whole application, I do the
scrolling/zooming stuff myself. So, for a diagram, a horizontal
scrollbar is displayed below the diagram that enabled to shift along the
x axis. This is (part of) the code:
------------------------8<-----------------------------------------------
from PyQt4 import QtGui, QtCore
from matplotlib.figure import Figure,SubplotParams
class DiagramWidget(QtGui.QWidget):
 def __init__(self, parent):
 QtGui.QWidget.__init__(self, parent)
 layout = QtGui.QVBoxLayout(self)
 self.diagram = InnerDiagramWidget(self)
 self.scrollbar = QtGui.QScrollBar(QtCore.Qt.Horizontal, self)
 self.connect(self.scrollbar, QtCore.SIGNAL('valueChanged(int)'),
 self.diagram.scroll_event)
 layout.addWidget(self.diagram)
 layout.addWidget(self.scrollbar)
# ...
class InnerDiagramWidget(FigureCanvas):
 def __init__(self, parent):
 fig = Figure(facecolor = 'w', 
 subplotpars = SubplotParams(left = 0.08, right=0.96, 
 bottom = 0.1, top=0.98))
 self.axes = fig.add_subplot(111)
 FigureCanvas.__init__(self, fig)
 FigureCanvas.setParent(self, parent)
 FigureCanvas.setSizePolicy(self,
 QtGui.QSizePolicy.Expanding,
 QtGui.QSizePolicy.Expanding)
 FigureCanvas.updateGeometry(self)
 def scroll_event(self, x):
 pass # here is real code ofcourse
# ...
------------------------8<-----------------------------------------------
However, when I put this DiagramWidget into a window and try to resize
it vertically by mouse (with some data ... about 4000 points), the
scrollbar is not alwas shown correctly.
One can see that the diagram widget size does not change with every mouse
move, and the scrollbar sometimes goes out of the visible window, where
it is unusable.
The similar occurres in the horizontal direction: sometimes the
scrollbar gets not updated properly. This is the case when the Figure
canvas takes a long time for update.
If I put the scrollbar on top of the widget, everything is fine, except
that is the wrong place for a scrollbar :-)
Is this a bug in FigureCanvas, in Qt or in my code? How can I debug and
solve this?
Best regards
Ole
From: guillaume r. <gra...@wy...> - 2009年05月27日 15:41:28
Yes, that's obviously what I should have started this thread with :)
this is how I convert the xml into "plottable" arrays:
def getnamefrom(name,src,what):
 """extracts timestamps and 'what' from 'src' for 'name'"""
 buffwhat = []
 bufftime = []
 sortedbyname = []
 [sortedbyname.append(element) for
 element in src if
 element["name"] == name]
 for i in sortedbyname[:-1]:
 if i['name'] == name:
 bufftime.append(i["timestamp"]/1e9)
 buffwhat.append(i[what])
 return buffwhat,bufftime
x,y = getnamefrom("cpu0",cpustat,"usage")
plt.plot(x,y)
del cpustat
(yes, it's a hardware monitor :D)
basically, it seems cpustat is still refcounted somewhere.
I wonder if I should append(copy.copy(i[...])) instead?
or If I'm mis-interpreting what I see with top. I'm trying to get infos
directly from the gc atm.
Michael Droettboom wrote:
> It's not off topic -- and I understand what you're trying to do much
> better now.
> 
> I assume at some point you convert all of the xml into a Numpy array and
> pass that to matplotlib? matplotlib will only keep a reference to the
> Numpy array, which should be far more compact, and you can safely remove
> the references to the xml tree and that memory should be freed.
> 
> Cheers,
> Mike
> 
> guillaume ranquet wrote:
>> sorry If my last message was confusing.
>> I'm exctracting data from an xml file (100megs of xml) which is stored
>> by my app as an array of dict in which I pick only some keys to plot.
>> I'm just trying to figure out if the gc is able to free some parts of
>> the dict (the un-plotted parts) by itself (and it seems not) or If I
>> have to give more hints to the gc.
>> my gig of ram is getting used, and I'd like to increase the set of data
>> a bit.
>>
>> I can make a hardcopy of my datas, pass this copy to matplotlib and del
>> everything (so that it *should* be clean, from my understandings).
>>
>> actually, my design is quite horrible. prolly a rewrite from scratch is
>> the best thing to do.
>>
>> anyway, it's a bit off-topic on the matplotlib user list :)
>>
>> Michael Droettboom wrote:
>> 
>>> I don't follow... If you need to free the data, you have to ensure that
>>> matplotlib doesn't need it, and the only way to do that is destroy the
>>> figure that references it. It's virtually impossible to create a
>>> dangling reference in Python (from within Python).
>>>
>>> Mike
>>>
>>> guillaume ranquet wrote:
>>> 
>>>> Thanks Mike,
>>>> I just wanted to be sure wether matplotlib had a copy or not.
>>>> I'll have to work on giving hints to the GC then...
>>>>
>>>> guillaume.
>>>>
>>>> Michael Droettboom wrote:
>>>> 
>>>> 
>>>>> Yes, Python is reference counted (with a garbage collector to handle
>>>>> cycles etc.). So, yes, the matplotlib plot keeps a "reference" to
>>>>> your
>>>>> data after you pass it in so it continue to redraw it as the plot is
>>>>> panned/zoomed/resized etc. You can safely del your local
>>>>> reference, but
>>>>> the memory itself will not be freed, since matplotlib still needs it.
>>>>>
>>>>> Mike
>>>>>
>>>>> guillaume ranquet wrote:
>>>>> 
>>>>>> I'm currently trying to improve my app to render more and more data.
>>>>>> I'm wondering if matplotlib keeps an internal copy of the datas once
>>>>>> the
>>>>>> plot function has been called?
>>>>>>
>>>>>> from what I understand from python (I'm quite new to python),
>>>>>> everything
>>>>>> is reference and no implicit copies are done. I'm trying to check on
>>>>>> matplotlib if it's the case but I must admit I got some
>>>>>> difficulties xD
>>>>>>
>>>>>>
>>>>>> to sum it up: can I del the arrays I just passed to an axis.plot ?
>>>>>>
>>>>>>
>>>>>> thanks for your help :)
>>>>>> ----
>>>>>> This message contains confidential information and may contain
>>>>>> information that is legally privileged. If you have received this
>>>>>> message by mistake, please immediately notify us and delete the
>>>>>> original message. Thank you. Ce message contient des informations
>>>>>> confidentielles. S'il vous est
>>>>>> parvenu par erreur, merci de bien vouloir nous en aviser par retour,
>>>>>> de n'en faire aucun usage et de n'en garder aucune copie.
>>>>>> ----
>>>>>>
>>>>>> ------------------------------------------------------------------------------
>>>>>>
>>>>>>
>>>>>>
>>>>>> Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
>>>>>> is a gathering of tech-side developers & brand creativity
>>>>>> professionals. Meet
>>>>>> the minds behind Google Creative Lab, Visual Complexity,
>>>>>> Processing, &
>>>>>> iPhoneDevCamp as they present alongside digital heavyweights like
>>>>>> Barbarian Group, R/GA, & Big Spaceship.
>>>>>> http://p.sf.net/sfu/creativitycat-com
>>>>>> _______________________________________________
>>>>>> Matplotlib-users mailing list
>>>>>> Mat...@li...
>>>>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>>>>> 
>>>> ----
>>>> This message contains confidential information and may contain
>>>> information that is legally privileged. If you have received this
>>>> message by mistake, please immediately notify us and delete the
>>>> original message. Thank you. Ce message contient des informations
>>>> confidentielles. S'il vous est
>>>> parvenu par erreur, merci de bien vouloir nous en aviser par retour,
>>>> de n'en faire aucun usage et de n'en garder aucune copie.
>>>> ----
>>>>
>>>> ------------------------------------------------------------------------------
>>>>
>>>>
>>>> Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
>>>> is a gathering of tech-side developers & brand creativity
>>>> professionals. Meet
>>>> the minds behind Google Creative Lab, Visual Complexity, Processing, &
>>>> iPhoneDevCamp as they present alongside digital heavyweights like
>>>> Barbarian Group, R/GA, & Big Spaceship.
>>>> http://p.sf.net/sfu/creativitycat-com
>>>> _______________________________________________
>>>> Matplotlib-users mailing list
>>>> Mat...@li...
>>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>>> 
>>
>> ----
>> This message contains confidential information and may contain
>> information that is legally privileged. If you have received this
>> message by mistake, please immediately notify us and delete the
>> original message. Thank you. 
>> Ce message contient des informations confidentielles. S'il vous est
>> parvenu par erreur, merci de bien vouloir nous en aviser par retour,
>> de n'en faire aucun usage et de n'en garder aucune copie.
>> ----
>>
>> ------------------------------------------------------------------------------
>>
>> Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
>> is a gathering of tech-side developers & brand creativity
>> professionals. Meet
>> the minds behind Google Creative Lab, Visual Complexity, Processing, &
>> iPhoneDevCamp as they present alongside digital heavyweights like
>> Barbarian Group, R/GA, & Big Spaceship.
>> http://p.sf.net/sfu/creativitycat-com
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>> 
> 
----
This message contains confidential information and may contain information that is legally privileged. If you have received this message by mistake, please immediately notify us and delete the original message. Thank you. 
Ce message contient des informations confidentielles. S'il vous est parvenu par erreur, merci de bien vouloir nous en aviser par retour, de n'en faire aucun usage et de n'en garder aucune copie.
----
From: Chaitanya K. <ic...@gm...> - 2009年05月27日 15:24:41
Hi all,
I am using the following rc params for the text font size
 plt.rc('font', size=10.0)
 plt.rc('xtick', labelsize='small')
 plt.rc('ytick', labelsize='small')
 plt.rc('legend', fontsize='medium', numpoints=1)
 plt.rc('mathtext', fontset='custom', it='serif:regular')
But font settings don't seem to be applied when I use
 plt.ylabel(r'$\Delta\mu \ \left[\mu_{B}\right]$')
Everytime I need to change the fontsize when the depending on the size
of the figure. Can this be avoided or am I missing something? It would
be nice if the font settings also apply math.text.
Cheers,
Chaitanya
From: Michael D. <md...@st...> - 2009年05月27日 15:05:35
It's not off topic -- and I understand what you're trying to do much 
better now.
I assume at some point you convert all of the xml into a Numpy array and 
pass that to matplotlib? matplotlib will only keep a reference to the 
Numpy array, which should be far more compact, and you can safely remove 
the references to the xml tree and that memory should be freed.
Cheers,
Mike
guillaume ranquet wrote:
> sorry If my last message was confusing.
> I'm exctracting data from an xml file (100megs of xml) which is stored
> by my app as an array of dict in which I pick only some keys to plot.
> I'm just trying to figure out if the gc is able to free some parts of
> the dict (the un-plotted parts) by itself (and it seems not) or If I
> have to give more hints to the gc.
> my gig of ram is getting used, and I'd like to increase the set of data
> a bit.
>
> I can make a hardcopy of my datas, pass this copy to matplotlib and del
> everything (so that it *should* be clean, from my understandings).
>
> actually, my design is quite horrible. prolly a rewrite from scratch is
> the best thing to do.
>
> anyway, it's a bit off-topic on the matplotlib user list :)
>
> Michael Droettboom wrote:
> 
>> I don't follow... If you need to free the data, you have to ensure that
>> matplotlib doesn't need it, and the only way to do that is destroy the
>> figure that references it. It's virtually impossible to create a
>> dangling reference in Python (from within Python).
>>
>> Mike
>>
>> guillaume ranquet wrote:
>> 
>>> Thanks Mike,
>>> I just wanted to be sure wether matplotlib had a copy or not.
>>> I'll have to work on giving hints to the GC then...
>>>
>>> guillaume.
>>>
>>> Michael Droettboom wrote:
>>> 
>>> 
>>>> Yes, Python is reference counted (with a garbage collector to handle
>>>> cycles etc.). So, yes, the matplotlib plot keeps a "reference" to your
>>>> data after you pass it in so it continue to redraw it as the plot is
>>>> panned/zoomed/resized etc. You can safely del your local reference, but
>>>> the memory itself will not be freed, since matplotlib still needs it.
>>>>
>>>> Mike
>>>>
>>>> guillaume ranquet wrote:
>>>> 
>>>> 
>>>>> I'm currently trying to improve my app to render more and more data.
>>>>> I'm wondering if matplotlib keeps an internal copy of the datas once
>>>>> the
>>>>> plot function has been called?
>>>>>
>>>>> from what I understand from python (I'm quite new to python),
>>>>> everything
>>>>> is reference and no implicit copies are done. I'm trying to check on
>>>>> matplotlib if it's the case but I must admit I got some difficulties xD
>>>>>
>>>>>
>>>>> to sum it up: can I del the arrays I just passed to an axis.plot ?
>>>>>
>>>>>
>>>>> thanks for your help :)
>>>>> ----
>>>>> This message contains confidential information and may contain
>>>>> information that is legally privileged. If you have received this
>>>>> message by mistake, please immediately notify us and delete the
>>>>> original message. Thank you. Ce message contient des informations
>>>>> confidentielles. S'il vous est
>>>>> parvenu par erreur, merci de bien vouloir nous en aviser par retour,
>>>>> de n'en faire aucun usage et de n'en garder aucune copie.
>>>>> ----
>>>>>
>>>>> ------------------------------------------------------------------------------
>>>>>
>>>>>
>>>>> Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
>>>>> is a gathering of tech-side developers & brand creativity
>>>>> professionals. Meet
>>>>> the minds behind Google Creative Lab, Visual Complexity, Processing, &
>>>>> iPhoneDevCamp as they present alongside digital heavyweights like
>>>>> Barbarian Group, R/GA, & Big Spaceship.
>>>>> http://p.sf.net/sfu/creativitycat-com
>>>>> _______________________________________________
>>>>> Matplotlib-users mailing list
>>>>> Mat...@li...
>>>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>>>> 
>>>>> 
>>> ----
>>> This message contains confidential information and may contain
>>> information that is legally privileged. If you have received this
>>> message by mistake, please immediately notify us and delete the
>>> original message. Thank you. 
>>> Ce message contient des informations confidentielles. S'il vous est
>>> parvenu par erreur, merci de bien vouloir nous en aviser par retour,
>>> de n'en faire aucun usage et de n'en garder aucune copie.
>>> ----
>>>
>>> ------------------------------------------------------------------------------
>>>
>>> Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
>>> is a gathering of tech-side developers & brand creativity
>>> professionals. Meet
>>> the minds behind Google Creative Lab, Visual Complexity, Processing, &
>>> iPhoneDevCamp as they present alongside digital heavyweights like
>>> Barbarian Group, R/GA, & Big Spaceship.
>>> http://p.sf.net/sfu/creativitycat-com
>>> _______________________________________________
>>> Matplotlib-users mailing list
>>> Mat...@li...
>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>> 
>>> 
>
> ----
> This message contains confidential information and may contain information that is legally privileged. If you have received this message by mistake, please immediately notify us and delete the original message. Thank you. 
>
> Ce message contient des informations confidentielles. S'il vous est parvenu par erreur, merci de bien vouloir nous en aviser par retour, de n'en faire aucun usage et de n'en garder aucune copie.
> ----
>
> ------------------------------------------------------------------------------
> Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT 
> is a gathering of tech-side developers & brand creativity professionals. Meet
> the minds behind Google Creative Lab, Visual Complexity, Processing, & 
> iPhoneDevCamp as they present alongside digital heavyweights like Barbarian 
> Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com 
> _______________________________________________
> 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: guillaume r. <gra...@wy...> - 2009年05月27日 14:56:54
sorry If my last message was confusing.
I'm exctracting data from an xml file (100megs of xml) which is stored
by my app as an array of dict in which I pick only some keys to plot.
I'm just trying to figure out if the gc is able to free some parts of
the dict (the un-plotted parts) by itself (and it seems not) or If I
have to give more hints to the gc.
my gig of ram is getting used, and I'd like to increase the set of data
a bit.
I can make a hardcopy of my datas, pass this copy to matplotlib and del
everything (so that it *should* be clean, from my understandings).
actually, my design is quite horrible. prolly a rewrite from scratch is
the best thing to do.
anyway, it's a bit off-topic on the matplotlib user list :)
Michael Droettboom wrote:
> I don't follow... If you need to free the data, you have to ensure that
> matplotlib doesn't need it, and the only way to do that is destroy the
> figure that references it. It's virtually impossible to create a
> dangling reference in Python (from within Python).
> 
> Mike
> 
> guillaume ranquet wrote:
>> Thanks Mike,
>> I just wanted to be sure wether matplotlib had a copy or not.
>> I'll have to work on giving hints to the GC then...
>>
>> guillaume.
>>
>> Michael Droettboom wrote:
>> 
>>> Yes, Python is reference counted (with a garbage collector to handle
>>> cycles etc.). So, yes, the matplotlib plot keeps a "reference" to your
>>> data after you pass it in so it continue to redraw it as the plot is
>>> panned/zoomed/resized etc. You can safely del your local reference, but
>>> the memory itself will not be freed, since matplotlib still needs it.
>>>
>>> Mike
>>>
>>> guillaume ranquet wrote:
>>> 
>>>> I'm currently trying to improve my app to render more and more data.
>>>> I'm wondering if matplotlib keeps an internal copy of the datas once
>>>> the
>>>> plot function has been called?
>>>>
>>>> from what I understand from python (I'm quite new to python),
>>>> everything
>>>> is reference and no implicit copies are done. I'm trying to check on
>>>> matplotlib if it's the case but I must admit I got some difficulties xD
>>>>
>>>>
>>>> to sum it up: can I del the arrays I just passed to an axis.plot ?
>>>>
>>>>
>>>> thanks for your help :)
>>>> ----
>>>> This message contains confidential information and may contain
>>>> information that is legally privileged. If you have received this
>>>> message by mistake, please immediately notify us and delete the
>>>> original message. Thank you. Ce message contient des informations
>>>> confidentielles. S'il vous est
>>>> parvenu par erreur, merci de bien vouloir nous en aviser par retour,
>>>> de n'en faire aucun usage et de n'en garder aucune copie.
>>>> ----
>>>>
>>>> ------------------------------------------------------------------------------
>>>>
>>>>
>>>> Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
>>>> is a gathering of tech-side developers & brand creativity
>>>> professionals. Meet
>>>> the minds behind Google Creative Lab, Visual Complexity, Processing, &
>>>> iPhoneDevCamp as they present alongside digital heavyweights like
>>>> Barbarian Group, R/GA, & Big Spaceship.
>>>> http://p.sf.net/sfu/creativitycat-com
>>>> _______________________________________________
>>>> Matplotlib-users mailing list
>>>> Mat...@li...
>>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>>> 
>>
>> ----
>> This message contains confidential information and may contain
>> information that is legally privileged. If you have received this
>> message by mistake, please immediately notify us and delete the
>> original message. Thank you. 
>> Ce message contient des informations confidentielles. S'il vous est
>> parvenu par erreur, merci de bien vouloir nous en aviser par retour,
>> de n'en faire aucun usage et de n'en garder aucune copie.
>> ----
>>
>> ------------------------------------------------------------------------------
>>
>> Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
>> is a gathering of tech-side developers & brand creativity
>> professionals. Meet
>> the minds behind Google Creative Lab, Visual Complexity, Processing, &
>> iPhoneDevCamp as they present alongside digital heavyweights like
>> Barbarian Group, R/GA, & Big Spaceship.
>> http://p.sf.net/sfu/creativitycat-com
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>> 
> 
----
This message contains confidential information and may contain information that is legally privileged. If you have received this message by mistake, please immediately notify us and delete the original message. Thank you. 
Ce message contient des informations confidentielles. S'il vous est parvenu par erreur, merci de bien vouloir nous en aviser par retour, de n'en faire aucun usage et de n'en garder aucune copie.
----
From: Michael D. <md...@st...> - 2009年05月27日 14:38:41
I don't follow... If you need to free the data, you have to ensure that 
matplotlib doesn't need it, and the only way to do that is destroy the 
figure that references it. It's virtually impossible to create a 
dangling reference in Python (from within Python).
Mike
guillaume ranquet wrote:
> Thanks Mike,
> I just wanted to be sure wether matplotlib had a copy or not.
> I'll have to work on giving hints to the GC then...
>
> guillaume.
>
> Michael Droettboom wrote:
> 
>> Yes, Python is reference counted (with a garbage collector to handle
>> cycles etc.). So, yes, the matplotlib plot keeps a "reference" to your
>> data after you pass it in so it continue to redraw it as the plot is
>> panned/zoomed/resized etc. You can safely del your local reference, but
>> the memory itself will not be freed, since matplotlib still needs it.
>>
>> Mike
>>
>> guillaume ranquet wrote:
>> 
>>> I'm currently trying to improve my app to render more and more data.
>>> I'm wondering if matplotlib keeps an internal copy of the datas once the
>>> plot function has been called?
>>>
>>> from what I understand from python (I'm quite new to python), everything
>>> is reference and no implicit copies are done. I'm trying to check on
>>> matplotlib if it's the case but I must admit I got some difficulties xD
>>>
>>>
>>> to sum it up: can I del the arrays I just passed to an axis.plot ?
>>>
>>>
>>> thanks for your help :)
>>> ----
>>> This message contains confidential information and may contain
>>> information that is legally privileged. If you have received this
>>> message by mistake, please immediately notify us and delete the
>>> original message. Thank you. 
>>> Ce message contient des informations confidentielles. S'il vous est
>>> parvenu par erreur, merci de bien vouloir nous en aviser par retour,
>>> de n'en faire aucun usage et de n'en garder aucune copie.
>>> ----
>>>
>>> ------------------------------------------------------------------------------
>>>
>>> Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
>>> is a gathering of tech-side developers & brand creativity
>>> professionals. Meet
>>> the minds behind Google Creative Lab, Visual Complexity, Processing, &
>>> iPhoneDevCamp as they present alongside digital heavyweights like
>>> Barbarian Group, R/GA, & Big Spaceship.
>>> http://p.sf.net/sfu/creativitycat-com
>>> _______________________________________________
>>> Matplotlib-users mailing list
>>> Mat...@li...
>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>> 
>>> 
>
> ----
> This message contains confidential information and may contain information that is legally privileged. If you have received this message by mistake, please immediately notify us and delete the original message. Thank you. 
>
> Ce message contient des informations confidentielles. S'il vous est parvenu par erreur, merci de bien vouloir nous en aviser par retour, de n'en faire aucun usage et de n'en garder aucune copie.
> ----
>
> ------------------------------------------------------------------------------
> Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT 
> is a gathering of tech-side developers & brand creativity professionals. Meet
> the minds behind Google Creative Lab, Visual Complexity, Processing, & 
> iPhoneDevCamp as they present alongside digital heavyweights like Barbarian 
> Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com 
> _______________________________________________
> 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: guillaume r. <gra...@wy...> - 2009年05月27日 14:16:00
Thanks Mike,
I just wanted to be sure wether matplotlib had a copy or not.
I'll have to work on giving hints to the GC then...
guillaume.
Michael Droettboom wrote:
> Yes, Python is reference counted (with a garbage collector to handle
> cycles etc.). So, yes, the matplotlib plot keeps a "reference" to your
> data after you pass it in so it continue to redraw it as the plot is
> panned/zoomed/resized etc. You can safely del your local reference, but
> the memory itself will not be freed, since matplotlib still needs it.
> 
> Mike
> 
> guillaume ranquet wrote:
>> I'm currently trying to improve my app to render more and more data.
>> I'm wondering if matplotlib keeps an internal copy of the datas once the
>> plot function has been called?
>>
>> from what I understand from python (I'm quite new to python), everything
>> is reference and no implicit copies are done. I'm trying to check on
>> matplotlib if it's the case but I must admit I got some difficulties xD
>>
>>
>> to sum it up: can I del the arrays I just passed to an axis.plot ?
>>
>>
>> thanks for your help :)
>> ----
>> This message contains confidential information and may contain
>> information that is legally privileged. If you have received this
>> message by mistake, please immediately notify us and delete the
>> original message. Thank you. 
>> Ce message contient des informations confidentielles. S'il vous est
>> parvenu par erreur, merci de bien vouloir nous en aviser par retour,
>> de n'en faire aucun usage et de n'en garder aucune copie.
>> ----
>>
>> ------------------------------------------------------------------------------
>>
>> Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
>> is a gathering of tech-side developers & brand creativity
>> professionals. Meet
>> the minds behind Google Creative Lab, Visual Complexity, Processing, &
>> iPhoneDevCamp as they present alongside digital heavyweights like
>> Barbarian Group, R/GA, & Big Spaceship.
>> http://p.sf.net/sfu/creativitycat-com
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>> 
> 
----
This message contains confidential information and may contain information that is legally privileged. If you have received this message by mistake, please immediately notify us and delete the original message. Thank you. 
Ce message contient des informations confidentielles. S'il vous est parvenu par erreur, merci de bien vouloir nous en aviser par retour, de n'en faire aucun usage et de n'en garder aucune copie.
----
From: Michael D. <md...@st...> - 2009年05月27日 14:12:37
Yes, Python is reference counted (with a garbage collector to handle 
cycles etc.). So, yes, the matplotlib plot keeps a "reference" to your 
data after you pass it in so it continue to redraw it as the plot is 
panned/zoomed/resized etc. You can safely del your local reference, but 
the memory itself will not be freed, since matplotlib still needs it.
Mike
guillaume ranquet wrote:
> I'm currently trying to improve my app to render more and more data.
> I'm wondering if matplotlib keeps an internal copy of the datas once the
> plot function has been called?
>
> from what I understand from python (I'm quite new to python), everything
> is reference and no implicit copies are done. I'm trying to check on
> matplotlib if it's the case but I must admit I got some difficulties xD
>
>
> to sum it up: can I del the arrays I just passed to an axis.plot ?
>
>
> thanks for your help :)
> ----
> This message contains confidential information and may contain information that is legally privileged. If you have received this message by mistake, please immediately notify us and delete the original message. Thank you. 
>
> Ce message contient des informations confidentielles. S'il vous est parvenu par erreur, merci de bien vouloir nous en aviser par retour, de n'en faire aucun usage et de n'en garder aucune copie.
> ----
>
> ------------------------------------------------------------------------------
> Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT 
> is a gathering of tech-side developers & brand creativity professionals. Meet
> the minds behind Google Creative Lab, Visual Complexity, Processing, & 
> iPhoneDevCamp as they present alongside digital heavyweights like Barbarian 
> Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com 
> _______________________________________________
> 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: Michael D. <md...@st...> - 2009年05月27日 14:08:27
You can set the rcParam "path.simplify" to False to turn off this behavior.
However, the goal is that the simplification is not noticable -- if it 
is that may be a bug. Are you able to share your data so I can look 
into this further?
Cheers,
Mike
Will Grover wrote:
> Hello matplotlib users,
>
> I'm using matplotlib to plot some large data sets (1 million x,y
> pairs) and I've noticed that, when zoomed out to view the whole plot,
> it looks as if only every Nth point is being plotted, maybe in an
> attempt to improve plotting performance in complex plots. When I zoom
> in I can see points that were clearly missing in the zoomed-out view.
> Is there any way to override this so that the plot really does show
> all the points, regardless of zoom? I've included my really simple
> plotting code below, and I'm using the "scipy superpack" (python 2.5,
> matplotlib-0.98.6) on an OS X 10.5.7 Mac.
>
> Many thanks for any help!
>
> --Will
>
>
>
> import pylab
> import smr
> import sys
> for freqs, stats, chronos in smr.loadData(sys.argv[1:]): # loads data
> into numpy.arrays
> 	pylab.plot(chronos, freqs)
> 	pylab.show()
>
> ------------------------------------------------------------------------------
> Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT 
> is a gathering of tech-side developers & brand creativity professionals. Meet
> the minds behind Google Creative Lab, Visual Complexity, Processing, & 
> iPhoneDevCamp as they present alongside digital heavyweights like Barbarian 
> Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com 
> _______________________________________________
> 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: Sandro T. <mo...@de...> - 2009年05月27日 13:11:29
Hi all,
I'd like to adapt 'animation_blit_qt4.py' to a pure OO approach,
removing pylab from the code and move to something near to
'embedding_in_qt4.py'.
I tried a bit but failed miserably :(
What I'd like to achieve is use something like in
'embedding_in_qt4.py' but that can be updated using the timerEvent /
startTime paradigm (something similar to gobject.add_idle(func) but
this time for Qt4).
Can someone please give me a help on this?
Thanks a lot in advance,
-- 
Sandro Tosi (aka morph, morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi
From: guillaume r. <gra...@wy...> - 2009年05月27日 13:06:24
I'm currently trying to improve my app to render more and more data.
I'm wondering if matplotlib keeps an internal copy of the datas once the
plot function has been called?
from what I understand from python (I'm quite new to python), everything
 is reference and no implicit copies are done. I'm trying to check on
matplotlib if it's the case but I must admit I got some difficulties xD
to sum it up: can I del the arrays I just passed to an axis.plot ?
thanks for your help :)
----
This message contains confidential information and may contain information that is legally privileged. If you have received this message by mistake, please immediately notify us and delete the original message. Thank you. 
Ce message contient des informations confidentielles. S'il vous est parvenu par erreur, merci de bien vouloir nous en aviser par retour, de n'en faire aucun usage et de n'en garder aucune copie.
----
From: Sandro T. <mo...@de...> - 2009年05月27日 12:47:44
Hi,
On Wed, May 27, 2009 at 13:29, ninjasmith <hen...@gm...> wrote:
> I'm a bit new to matplotlib and python. I'm running ubuntu 64bit. whenever
> I try and do anything with matplotlib I get an error similar to above. it
> still works, i.e. when I run the show() command the plot will appear but all
> matplotplib commands return an error similar to above. for example
>
> In [15]: plot(a)
> Out[15]: [<matplotlib.lines.Line2D object at 0x28487d0>]
>
> In [16]: figure(2)
> Out[16]: <matplotlib.figure.Figure object at 0x2ddc150>
those are not error: what that line say is that you created an
instance of matplotlib.figure.Figure and that instance is located at
0x2ddc150 (it's a memory location).
if you do something like
p = plot(a)
you'll see this messages go away, since you assign the instance
reference to the variable p
Regards,
-- 
Sandro Tosi (aka morph, morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi
From: Stefanie L. <lu...@ip...> - 2009年05月27日 12:46:08
Hi!
I'm trying to print my plots in a wxScrolledPanel under Windows XP but it dosen't work. I only can print / preview the start of the plot on the left upper site, the rest of page is empty:
http://www.snowflake-sl.info/printing_in_wx.JPG
I used printing according the example of matplotlib printing_in_wx.py.
...
self.canvas = FigureCanvasWx(self.panel, -1, self.fig)
...
self.Bind(wx.EVT_MENU, self.onPrint, id=MENU_PRINT)
...
def onPrint(self,event=None):
 self.canvas.Printer_Print(event=event)
...
BTW if I want to run this demo, Python crashes.
Any ideas?
Kind regards,
Stefanie
22 messages has been excluded from this view by a project administrator.

Showing results of 523

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