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
(19) |
2
(30) |
3
(14) |
4
(1) |
|
5
(16) |
6
(7) |
7
(12) |
8
(14) |
9
(35) |
10
(16) |
11
(31) |
|
12
(6) |
13
(14) |
14
(13) |
15
(20) |
16
(15) |
17
(27) |
18
(5) |
|
19
(10) |
20
(22) |
21
(20) |
22
(30) |
23
(25) |
24
(11) |
25
(2) |
|
26
(2) |
27
(23) |
28
(20) |
29
(26) |
30
(25) |
31
(7) |
|
|
From: keflavich <kef...@gm...> - 2009-07-02 17:40:23
|
Hi, I'm using ipython 0.9.1 with the svn version of matplotlib on 64 bit python on mac os x 10.5.7. I have only been able to get python-64 running with the MacOSX backend; all of the others (wxpython, gtk, qt, tk) have failed for one reason or another. I've tried ipython without any flags and importing pylab on the command line: from pylab import * and ipython -pylab, and then plotting from a script. I retain access to the command line unless I type "show()" at the command line, at which point I can't return to the command line unless I close all of my graphics windows. I don't have this problem when running 32 bit python with qt or tk as the backends. Is this an error? Should there be a command-line flag for ipython to start threading for MacOSX specifically? Thanks, Adam -- View this message in context: http://www.nabble.com/ipython-threading-fails-with-macosx-backend-tp24311071p24311071.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
|
From: Stephane R. <ste...@gm...> - 2009-07-02 15:11:06
|
Yep, the same library (physical, on our network) fails depending only
the computer, thus on its own internal libraries called by GEOS.
By the way, I tried basemap with geos 3.0.4, and saw the "simplify()"
method working. That's funny!
On Thu, Jul 2, 2009 at 2:08 PM, Jeff Whitaker<js...@fa...> wrote:
> Stephane Raynaud wrote:
>>
>> Hi (Jeff),
>>
>>
>> I recently performed updates to matplotlib and basemap.
>> >From this time, I have a random and reccurent error when I create a
>> Basemap instance.
>> Here is one example :
>>
>>
>>>>>
>>>>> from mpl_toolkits.basemap import Basemap
>>>>> Basemap(**{'lon_0': -4.5250263598141309, 'urcrnrlat':
>>>>> 49.140154231678416, 'projection': 'cyl', 'llcrnrlon': -7.2999968048710144,
>>>>> 'lat_ts': 47.468781818043126, 'urcrnrlon': -1.7500559147572474,
>>>>> 'area_thresh': 0.1, 'llcrnrlat': 45.797409404407844, 'resolution': 'i',
>>>>> 'lat_0': 47.468781818043126})
>>>>>
>>
>> GEOS_ERROR: TopologyException: found non-noded intersection between
>> 8.67583 4.66292, 8.70206 4.66997 and 8.71039 4.67664, 8.67708 4.64997
>> 8.70205 4.66997
>>
>> It depends on the area and the resolution (polygons).
>>
>> I have version '0.99.3' of basemap.
>>
>> Any idea?
>>
>
> Stephane: I'd say it's an issue with your geos library installation that
> basemap is linking to. I don't see that error using your example for geos
> 2.2.3 or geos 3.0.3.
>
> I'd suggest rebuilding the geos library, then recompiling basemap.
>
> -Jeff
>
--
Stephane Raynaud
|
|
From: Jae-Joon L. <lee...@gm...> - 2009-07-02 15:05:36
|
I can reproduce the error with the svn version. It seems that the problem is not SubplotHost specific, i.e., you have same problem if you use mpl's original axes with twinx. I think it has something to do with the axes sharing in general. Preventing autoscale of xaxis suppress the error. host.set_autoscalex_on(False) par1.set_autoscalex_on(False) par2.set_autoscalex_on(False) But you have to manually adjust the x-limits later par1.set_xlim(dates[0], dates[-1]) However, autofmt_xdata does not work. And I guess this is a bug in the SubplotHost. I may take a more look later today. Regards, -JJ On Sun, Jun 28, 2009 at 1:34 PM, David GUERINEAU<da...@gu...> wrote: > Hi matplotlib_users ! > > I'm David from Berlin, and believe I'm experiencing some problem with the > SubplotHost module: > > I'm generating graphs from hudge databases of cpu and ethernet statistics, > and I wanted to mix several graphs concerning ethernet statistics in the > same figure, > with time as x axis, and bytes-in, bytes-out, packets-in, packets-out and > number of > collisions as three different y axes, with three different scale. > > I took the inspiration from > > for the x axes and from > > http://matplotlib.sourceforge.net/examples/axes_grid/demo_parasite_axes2.html > for the y axes > > The following code is a synthetic reproduction of the problem I'm > experiencing (it is also attached): > > from matplotlib.dates import date2num > from matplotlib import pyplot > from matplotlib import pylab > from mpl_toolkits.axes_grid.parasite_axes import SubplotHost > from datetime import datetime > > dates = [ 733581.20833333337, 733581.20837962965, 733581.20842592593, > 733581.20847222221, 733581.20851851848, > 733581.20855324075, 733581.20858796302, 733581.2086342593, > 733581.20866898145, 733581.20871527772] > rxB = [054L, 130L, 144L, 54L, 36L, 9L, 35L, 43L, 85L, 43L] > txB = [4L, 9L, 9L, 5L, 4L, 4L, 4L, 5L, 6L, 5L] > rxP = [77, 228, 251, 112, 77, 42, 75, 97, 147, 91] > txP = [61, 177, 188, 90, 61, 40, 64, 76, 113, 77] > col = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0] > > ethPlot = pyplot > fig = ethPlot.figure() > host = SubplotHost(fig, 111) > > host.set_ylabel("kB/s") > host.set_xlabel("Time") > > par1 = host.twinx() > par2 = host.twinx() > > par1.set_ylabel("Packets/s") > > par2.axis["right"].set_visible(False) > > offset = 60, 0 > new_axisline = par2.get_grid_helper().new_fixed_axis > par2.axis["right2"] = new_axisline(loc="right", > axes=par2, > offset=offset) > > par2.axis["right2"].label.set_visible(True) > par2.axis["right2"].set_label("Collisions") > > par1.set_ylim(0, 6000) > par2.set_ylim(0, 7000) > > host.axis([ dates[0], ( dates[0] + 0.041 ), -7000, 7000]) > par1.axis([ dates[0], ( dates[0] + 0.041 ), -10000, 10000]) > par2.axis([ dates[0], ( dates[0] + 0.041 ), -700, 700]) > > fig.add_axes(host) > ethPlot.subplots_adjust(right=0.75) > > drawRxByt, = host.plot_date(dates, rxB, 'g', tz=None, xdate=True, > ydate=False, label="kB/s in") > drawTxByt, = host.plot_date(dates, txB, 'b', tz=None, xdate=True, > ydate=False, label="kB/s out") > drawRxPaq, = par1.plot_date(dates, rxP, 'm', tz=None, xdate=True, > ydate=False, label="packets/s in") > drawTxPaq, = par1.plot_date(dates, txP, 'y', tz=None, xdate=True, > ydate=False, label="packets/s out") > drawColls, = par2.plot_date(dates, col, 'r', tz=None, xdate=True, > ydate=False, label="collisions") > > fig.autofmt_xdate() > > host.set_xlabel("Time") > host.set_ylabel("kB/s") > par1.set_ylabel("Packets/s") > > host.legend() > > host.axis["left"].label.set_color(drawRxByt.get_color()) > host.axis["left"].label.set_color(drawTxByt.get_color()) > par1.axis["right"].label.set_color(drawRxPaq.get_color()) > par1.axis["right"].label.set_color(drawtxPaq.get_color()) > par2.axis["right2"].label.set_color(drawColls.get_color()) > > ethPlot.draw() > pylab.savefig( './test.png', dpi=(640/8)) > > > > > Maybe I do something wrong somewhere here, but other scripts that do the > same for a single graphwork like a charm. So it's not a question of dataType > or something. To compare with a working code, here is the first version of > the fuction that does the job on single graphs without any problem : > > def drawEthGraph(filename, hdates, rxP, txP, rxB, txB, col): > ethPlot = pyplot > fig = ethPlot.figure() > ax = fig.add_subplot(111) > ax.plot_date(hdates, rxP, 'g', None, True, False) > ax.plot_date(hdates, txP, 'b', None, True, False) > ax.plot_date(hdates, rxB, 'g', None, True, False) > ax.plot_date(hdates, txB, 'b', None, True, False) > ax.plot_date(hdates, col, 'r', None, True, False) > ax.axis([ hdates[0], ( hdates[0] + 0.042 ), -7000, 7000]) > ax.grid(True) > fig.autofmt_xdate() > pylab.savefig( filename, dpi=(640/8)) > > > I don't think I understand the whole process of generation, but I thought at > least at the beginnig I was having a good feeling with this API. > Now I wonder how to go around this. Maybe you'll have an idea :-o > > Best regards > > DvD > > ------------------------------------------------------------------------------ > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > |
|
From: Ole S. <ole...@gm...> - 2009-07-02 14:44:22
|
Hello Darren, Darren Dale <dsd...@gm...> writes: > I can't produce a segfault with the attached script. I have Qt-4.5.2, > PyQt-4.5.1, and a checkout of the matplotlib trunk. OK, in this context it seems to work. I attach a script that shows the problem. Run it, move the second diagram below the first, adjust their sizes so that they take roughly the same size: +---------------+-------+ | Diagram 1 | | | | | | | Hello | +---------------+ World | | Diagram 2 | | | | | | | | +---------------+-------+ (you will see that the Diagram 2 will not alway update properly :-( [*] ) and then move the slider between the diagrams and the "Hello World" label. There is a good chance that the program will segfault. If it does not, increase the number of points in the diagrams. BTW,could you reproduce my last example with diagram and scrollbar? It still remains unsolved (and is reproduced here [*]). Versions (all 64 bit): openSUSE 11.1: Qt Open Source Edition 4.4.3 PyQt 4.4.3 Matplotlib 0.98.5.2 Kubuntu 9.04: Qt Open Source Edition 4.5.0 PyQt 4.4.4 Matplotlib 0.98.5.2 Best regards Ole |
|
From: Ole S. <ole...@gm...> - 2009-07-02 14:44:16
|
Hello Darren,
Darren Dale <dsd...@gm...> writes:
> I can't produce a segfault with the attached script. I have Qt-4.5.2,
> PyQt-4.5.1, and a checkout of the matplotlib trunk.
OK, in this context it seems to work.
I attach a script that shows the problem.
Run it, move the second diagram below the first, adjust their sizes so
that they take roughly the same size:
+---------------+-------+
| Diagram 1 | |
| | |
| | Hello |
+---------------+ World |
| Diagram 2 | |
| | |
| | |
+---------------+-------+
(you will see that the Diagram 2 will not always update properly :-( [*] )
and then move the slider between the diagrams and the "Hello World"
label. There is a good chance that the program will segfault. If it does
not, increase the number of points in the diagrams.
BTW, could you reproduce my last example with diagram and scrollbar? It
still remains unsolved (and is reproduced here [*]).
Versions (all 64 bit):
openSUSE 11.1:
Qt Open Source Edition 4.4.3
PyQt 4.4.3
Matplotlib 0.98.5.2
Kubuntu 9.04:
Qt Open Source Edition 4.5.0
PyQt 4.4.4
Matplotlib 0.98.5.2
Best regards
Ole
------------------------------------8<---------------------------------------
import random
import sys
from PyQt4 import QtGui, QtCore
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.figure import Figure,SubplotParams
class AppForm(QtGui.QMainWindow):
def __init__(self, parent=None):
QtGui.QMainWindow.__init__(self, parent)
self.create_dock_widgets()
self.resize(700, 600)
def create_dock_widgets(self):
self.setDockNestingEnabled(True)
w1 = QtGui.QDockWidget('Diagram 1', self)
self.addDockWidget(QtCore.Qt.TopDockWidgetArea, w1)
w1.setWidget(InnerDiagramWidget(self))
w2 = QtGui.QDockWidget('Diagram 2', self)
self.addDockWidget(QtCore.Qt.TopDockWidgetArea, w2)
w2.setWidget(InnerDiagramWidget(self))
w3 = QtGui.QDockWidget('Label', self)
self.addDockWidget(QtCore.Qt.TopDockWidgetArea, w3)
w3.setWidget(QtGui.QLabel('Hello World'))
class InnerDiagramWidget(FigureCanvas):
def __init__(self, parent):
fig = Figure()
self.axes = fig.add_subplot(111)
# Increase this number to rise your chances for a segfault.
range = xrange(1000)
l = [ random.randint(-5, 5) for i in range ]
self.axes.plot(range, l, drawstyle='steps')
FigureCanvas.__init__(self, fig)
self.setParent(parent)
FigureCanvas.setSizePolicy(self,
QtGui.QSizePolicy.Expanding,
QtGui.QSizePolicy.Expanding)
FigureCanvas.updateGeometry(self)
a = QtGui.QApplication(sys.argv)
w = AppForm()
w.show()
a.exec_()
------------------------------------8<---------------------------------------
|
|
From: Michael D. <md...@st...> - 2009-07-02 14:41:00
|
It is not surprising that memory usage is much lower without printing the plot. Very little is actually done by the "plot" command other than setting up a tree of objects that is later rendered during the printing process (where most of the work happens). The attached script based on what you provided doesn't leak memory for me with matplotlib 0.98.5.2. It would appear that there is something else in your application triggering the leak. Perhaps there is something holding a reference longer than it should? You can see from the attached massif plots that memory usage never becomes unbounded. It is normal for Python to delay deallocation for efficiency reasons. Calling gc.collect (the second graph) does help keep memory usage more compact however, if that is a primary concern. Cheers, Mike Ralf Gommers wrote: > Hi, > > I am working on a PyQt4 application with some embedded MPL figures, > and am also trying to save some figures as png's without displaying > them. I am observing huge memory increases (10s or 100s of Mb) the > moment I try to save a png. I reproduced the issue by combining two > mpl examples, > http://matplotlib.sourceforge.net/examples/user_interfaces/embedding_in_qt4.html > and http://matplotlib.sourceforge.net/examples/api/agg_oo.html. Full > code is attached. When pressing the "save figure" button, memory usage > shoots up, multiple clicks keep sending it higher (although not > monotonically). > > I tested on two different platforms > - Matplotlib 98.5.2 and Python 2.6.2 on Ubuntu. > - latest Enthought Python Distribution on Windows XP. > > The function that does the png saving is: > > def save_png(): > """Save an image as a png file""" > > pngpath = 'test_mplsave.png' > > fig = Figure() > canvas = FigureCanvas(fig) > ax = fig.add_subplot(111) > x = arange(5e3) > ax.plot(x, sin(x)) > canvas.print_figure(pngpath) > > ## tried all things commented out below, all makes no difference ## > #fig.savefig(pngpath) > > #del(fig) > #del(canvas) > #del(ax) > > #import matplotlib.pyplot as plt > #plt.close(fig) > > #import gc > #gc.collect() > > Commenting out the canvas.print_figure line fixes the issue. > > Am I doing something obviously wrong, or mixing two incompatible ways > of doing things? > > Cheers, > Ralf > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > ------------------------------------------------------------------------ > > _______________________________________________ > 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: Darren D. <dsd...@gm...> - 2009-07-02 13:17:39
|
On Thu, Jul 2, 2009 at 3:06 AM, Ole Streicher <ole...@gm...>wrote: > Hi Brian, > > I have also some layout problems with the Qt4 backend. The worst one is > a SegFault when adjusting the width. > > Brian Zambrano <br...@gm...> writes: > > vbox = QVBoxLayout() > > vbox.addWidget(self.canvas) > > self.setLayout(vbox) > > Could you just try to add a second canvas to the layout? > > vbox = QVBoxLayout() > vbox.addWidget(self.canvas1) > vbox.addWidget(self.canvas2) > self.setLayout(vbox) > > and then try to adjust the size by moving the separator between the > central and right widget? In my code, I can reproduce a crash here on > Linux. Also, depending on the speed (content) of the canvases, the width > is not always ajusted correctly. > > I am still not sure whether this is fault of Qt, PyQt, or matplotlib. > I can't produce a segfault with the attached script. I have Qt-4.5.2, PyQt-4.5.1, and a checkout of the matplotlib trunk. Darren |
|
From: Jeff W. <js...@fa...> - 2009-07-02 12:09:10
|
Stephane Raynaud wrote:
> Hi (Jeff),
>
>
> I recently performed updates to matplotlib and basemap.
> >From this time, I have a random and reccurent error when I create a
> Basemap instance.
> Here is one example :
>
>
>>>> from mpl_toolkits.basemap import Basemap
>>>> Basemap(**{'lon_0': -4.5250263598141309, 'urcrnrlat': 49.140154231678416, 'projection': 'cyl', 'llcrnrlon': -7.2999968048710144, 'lat_ts': 47.468781818043126, 'urcrnrlon': -1.7500559147572474, 'area_thresh': 0.1, 'llcrnrlat': 45.797409404407844, 'resolution': 'i', 'lat_0': 47.468781818043126})
>>>>
>
> GEOS_ERROR: TopologyException: found non-noded intersection between
> 8.67583 4.66292, 8.70206 4.66997 and 8.71039 4.67664, 8.67708 4.64997
> 8.70205 4.66997
>
> It depends on the area and the resolution (polygons).
>
> I have version '0.99.3' of basemap.
>
> Any idea?
>
Stephane: I'd say it's an issue with your geos library installation
that basemap is linking to. I don't see that error using your example
for geos 2.2.3 or geos 3.0.3.
I'd suggest rebuilding the geos library, then recompiling basemap.
-Jeff
|
|
From: Stephane R. <ste...@gm...> - 2009-07-02 10:28:26
|
Hi (Jeff),
I recently performed updates to matplotlib and basemap.
>From this time, I have a random and reccurent error when I create a
Basemap instance.
Here is one example :
>>> from mpl_toolkits.basemap import Basemap
>>> Basemap(**{'lon_0': -4.5250263598141309, 'urcrnrlat': 49.140154231678416, 'projection': 'cyl', 'llcrnrlon': -7.2999968048710144, 'lat_ts': 47.468781818043126, 'urcrnrlon': -1.7500559147572474, 'area_thresh': 0.1, 'llcrnrlat': 45.797409404407844, 'resolution': 'i', 'lat_0': 47.468781818043126})
GEOS_ERROR: TopologyException: found non-noded intersection between
8.67583 4.66292, 8.70206 4.66997 and 8.71039 4.67664, 8.67708 4.64997
8.70205 4.66997
It depends on the area and the resolution (polygons).
I have version '0.99.3' of basemap.
Any idea?
--
Stephane Raynaud
|
|
From: Ole S. <ole...@gm...> - 2009-07-02 07:07:15
|
Hi Brian, I have also some layout problems with the Qt4 backend. The worst one is a SegFault when adjusting the width. Brian Zambrano <br...@gm...> writes: > vbox = QVBoxLayout() > vbox.addWidget(self.canvas) > self.setLayout(vbox) Could you just try to add a second canvas to the layout? vbox = QVBoxLayout() vbox.addWidget(self.canvas1) vbox.addWidget(self.canvas2) self.setLayout(vbox) and then try to adjust the size by moving the separator between the central and right widget? In my code, I can reproduce a crash here on Linux. Also, depending on the speed (content) of the canvases, the width is not always ajusted correctly. I am still not sure whether this is fault of Qt, PyQt, or matplotlib. Thanks Ole |
|
From: Brian Z. <br...@gm...> - 2009-07-02 05:02:51
|
Hi all, I'm having a problem with resizing a FigureCanvas using the Qt4 backend when the FigureCanvas is used alongside some dock widgets. What happens is that the figure never grows beyond the original size set when the window or other dock widgets are expanded. It's probably easier to look at a screenshot taken after I resized (grew) things a bit: http://brianz.s3.amazonaws.com/mpl_buggy.png The simple code I used to generate and test this is located here: http://brianz.s3.amazonaws.com/mpl_qt_buggy.py.txt To get the FigureCanvas to resize at all, I'm passing the resizeEvent from the parent widget down to the FigureCanvas's resizeEvent. Am I doing something incorrectly here or is this a bug? Thanks, BZ |
|
From: Fabrice S. <si...@lm...> - 2009-07-02 04:14:13
|
Le mercredi 01 juillet 2009 à 10:13 +0200, Sandro Tosi a écrit : > On Tue, Jun 30, 2009 at 14:12, Fabrice Silva<si...@lm...> wrote: > > Le lundi 29 juin 2009 à 16:11 -0400, Jae-Joon Lee a écrit : > >> In the svn version of matplotlib, there are some helper classes to > >> ease this job a bit. > > Thanks for your pointer. Sadly the mpl.toolkits.axes_grid is not shipped > > by debian package, and downloading it requires other stuff. So I adapted > > I'm the debian maintainer for matplotlib: if you need something > missing in Debian, get in touch with us, for example reporting a bug > against matplotlib requesting this toolkit. > > I didn't check further, but probably it was not release because of > this phrase: "In the svn version of matplotlib". Hi Sandro, thanks for packaging matplotlib for debian. I hope you did not understand my words as a blame. In fact mpl_toolkits.axes_grid is still in svn only and not in 0.98.x I tried to download the mpl.toolkits.axes_grid module files, but I had errors raising when importing that... -- Fabrice Silva <si...@lm...> LMA UPR CNRS 7051 |
|
From: Jeff W. <js...@fa...> - 2009-07-02 03:21:51
|
Alexandar Hansen wrote: > Hello, > > I've been struggling with this for a while now and have effectively > two issues. One, how can I define the range over which hexbin ... > bins? And two, how do I change the background color of a plot? Alexandar: To change the background color to the lowest value in the colormap: ax = plt.gca() ax.set_axis_bgcolor(plt.cm.jet(0)) -Jeff > The latter I thought would be trivial, but nothing I've tried has > worked. Let's take the example: > > import numpy as np > import matplotlib.cm <http://matplotlib.cm> as cm > import matplotlib.pyplot as plt > > n = 100000 > x = np.random.standard_normal(n) > y = 2.0 + 3.0 * x + 4.0 * np.random.standard_normal(n) > #xmin = x.min() > #xmax = x.max() > #ymin = y.min() > #ymax = y.max() > xmin = 0 > xmax = 10 > ymin = 0 > ymax = 30 > > plt.hexbin(x,y, cmap=cm.jet) > #plt.hexbin(x,y, cmap=cm.jet, extent=[xmin, xmax, ymin, ymax]) > plt.axis([xmin, xmax, ymin, ymax]) > plt.title("Hexagon binning") > cb = plt.colorbar() > cb.set_label('counts') > > plt.show() > > > Let's say i'm only interested in the positive quadrant of the data, so > I only want to bin data in the range of 0-10 in x and 0-30 in y. The > first thing I tried was to use the extent option to only bin the > specified range of data, but that gives these errors: > > [tesla:~/NMR/500-Tupp/IM7][349] HexBin.py > Traceback (most recent call last): > File "HexBin.py", line 28, in <module> > plt.hexbin(x,y, cmap=cm.jet, extent=[xmin, xmax, ymin, ymax]) > File "/usr/lib64/python2.5/site-packages/matplotlib/pyplot.py", line > 1920, in hexbin > ret = gca().hexbin(*args, **kwargs) > File "/usr/lib64/python2.5/site-packages/matplotlib/axes.py", line > 5447, in hexbin > collection.update(kwargs) > File "/usr/lib64/python2.5/site-packages/matplotlib/artist.py", line > 548, in update > raise AttributeError('Unknown property %s'%k) > AttributeError: Unknown property extent > > > After that, I just set the plt.axis range to what I'm interested in. > However, the range not binned by hexbin shows up as white, instead of > the 0-count blue. I've tried adding facecolor, edgecolor, axisbg, and > who knows what else as part of plt.hexbin, plt.axis, and plt.savefig, > But most have no consequence on the plot. plt.savefig(myname, > facecolor='blue') successfully changed everything blue except the > white region within the plot. > > So, where am I going wrong? I'm finding myself out of options and > would ideally not like to trim or add false points to my data just to > get the axis and colors correct. > > Best, > Alex > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > > ------------------------------------------------------------------------ > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
|
From: Stephen G. <ste...@op...> - 2009-07-02 01:07:10
|
Hi,
I just downloaded matplotlib-0.98.5.3.win32-py2.6.exe from sourceforge.
I have an existing Application that works fine with
python : 2.5.4 final 0
pyGTK : 2.12.1
GTK+ : 2.14.7
numpy : 1.2.1
matplotlib : 0.98.5.2
Now I am trying the same App on
python version : 2.6.0 final 0
pyGTK version : 2.12.1
gtk+ version : 2.16.2
numpy version : 1.3.0
matplotlib version: 0.98.5.3
I got the following traceback, I'm wondering:
- Am I looking at changes due to the different matplotlib versions?
- Are some bits are missing in the downloaded installer ?
- or is there incompatibility with the newer versions of GTK?
importing matplotlib
Traceback (most recent call last):
File "C:\SVNproj\FrictionTests2\PyGTKFricPlot.py", line 17, in <module>
from matplotlib.backends.backend_gtk import FigureCanvasGTK as
FigureCanvas
File
"C:\Python26\Lib\site-packages\matplotlib\backends\backend_gtk.py", line
25, in <module>
from matplotlib.backends.backend_gdk import RendererGDK, FigureCanvasGDK
File
"C:\Python26\Lib\site-packages\matplotlib\backends\backend_gdk.py", line
29, in <module>
from matplotlib.backends._backend_gdk import pixbuf_get_pixels_array
ImportError: No module named _backend_gdk
Thanks for any clues
Steve
|
|
From: Brian Z. <br...@gm...> - 2009-07-02 00:09:15
|
As usual, I ended up figuring this out after I sent this question. The trick was adding the central widget (FigureCanvas) to a QLayout, and just ignoring the resizeEvent. So, I just did: vbox = QVBoxLayout() vbox.addWidget(self.canvas) self.setLayout(vbox) in the custom QWidget which holds the canvas and everything worked fine. I also removed the overridden resizeEvent. BZ On Wed, Jul 1, 2009 at 1:17 PM, Brian Zambrano <br...@gm...> wrote: > Hi all, > > I'm having a problem with resizing a FigureCanvas using the Qt4 backend > when the FigureCanvas is used alongside some dock widgets. What happens is > that the figure never grows beyond the original size set when the window or > other dock widgets are expanded. It's probably easier to look at a > screenshot taken after I resized (grew) things a bit: > > http://brianz.s3.amazonaws.com/mpl_buggy.png > > The simple code I used to generate and test this is located here: > > http://brianz.s3.amazonaws.com/mpl_qt_buggy.py.txt > > To get the FigureCanvas to resize at all, I'm passing the resizeEvent from > the parent widget down to the FigureCanvas's resizeEvent. > > Am I doing something incorrectly here or is this a bug? > > Thanks, > BZ > |
|
From: Ralf G. <ral...@go...> - 2009-07-01 22:41:32
|
#!/usr/bin/env python
# embedding_in_qt4.py --- Simple Qt4 application embedding matplotlib canvases
#
# Copyright (C) 2005 Florent Rougon
# 2006 Darren Dale
#
# This file is an example program for matplotlib. It may be used and
# modified with no restriction; raw copies as well as modified versions
# may be distributed without limitation.
import sys, os, random
from PyQt4 import QtGui, QtCore
from numpy import arange, sin, pi
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.figure import Figure
class MyMplCanvas(FigureCanvas):
"""Ultimately, this is a QWidget (as well as a FigureCanvasAgg, etc.)."""
def __init__(self, parent=None, width=5, height=4, dpi=100):
fig = Figure(figsize=(width, height), dpi=dpi)
self.axes = fig.add_subplot(111)
# We want the axes cleared every time plot() is called
self.axes.hold(False)
self.compute_initial_figure()
FigureCanvas.__init__(self, fig)
self.setParent(parent)
FigureCanvas.setSizePolicy(self,
QtGui.QSizePolicy.Expanding,
QtGui.QSizePolicy.Expanding)
FigureCanvas.updateGeometry(self)
def compute_initial_figure(self):
pass
class MyStaticMplCanvas(MyMplCanvas):
"""Simple canvas with a sine plot."""
def compute_initial_figure(self):
t = arange(0.0, 3.0, 0.01)
s = sin(2*pi*t)
self.axes.plot(t, s)
def save_png():
"""Save an image as a png file"""
pngpath = 'test_mplsave.png'
fig = Figure()
canvas = FigureCanvas(fig)
ax = fig.add_subplot(111)
x = arange(5e3)
ax.plot(x, sin(x))
#canvas.print_figure(pngpath)
## tried all things commented out below, all makes no difference ##
#fig.savefig(pngpath)
#del(fig)
#del(canvas)
#del(ax)
#import matplotlib.pyplot as plt
#plt.close(fig)
#import gc
#gc.collect()
class ApplicationWindow(QtGui.QMainWindow):
def __init__(self):
QtGui.QMainWindow.__init__(self)
self.setAttribute(QtCore.Qt.WA_DeleteOnClose)
self.setWindowTitle("application main window")
self.file_menu = QtGui.QMenu('&File', self)
self.file_menu.addAction('&Quit', self.fileQuit,
QtCore.Qt.CTRL + QtCore.Qt.Key_Q)
self.menuBar().addMenu(self.file_menu)
self.help_menu = QtGui.QMenu('&Help', self)
self.main_widget = QtGui.QWidget(self)
l = QtGui.QVBoxLayout(self.main_widget)
sc = MyStaticMplCanvas(self.main_widget, width=5, height=4, dpi=100)
dc = QtGui.QPushButton('Save image')
l.addWidget(sc)
l.addWidget(dc)
self.main_widget.setFocus()
self.setCentralWidget(self.main_widget)
self.statusBar().showMessage("All hail matplotlib!", 2000)
self.connect(dc, QtCore.SIGNAL("clicked()"), save_png)
def fileQuit(self):
self.close()
def closeEvent(self, ce):
self.fileQuit()
qApp = QtGui.QApplication(sys.argv)
aw = ApplicationWindow()
aw.setWindowTitle("Try saving a simple png image")
aw.show()
sys.exit(qApp.exec_()) |
|
From: Gökhan S. <gok...@gm...> - 2009-07-01 20:35:00
|
On Wed, Jul 1, 2009 at 3:25 PM, David Paulsen<dav...@du...> wrote: > Script passed the previous error point, and a different error string this > time: > > File "3D_line_plot_ex.py", line 32, in <module> > ax.add_collection3d(poly, zs=zs, zdir='y') > > File > "/Library/Frameworks/Python.framework/Versions/4.2.30201/lib/python2.5/site- > packages/mpl_toolkits/mplot3d/axes3d.py", line 807, in add_collection3d > art3d.poly_collection_2d_to_3d(col, zs=zs, zdir=zdir) > > File > "/Library/Frameworks/Python.framework/Versions/4.2.30201/lib/python2.5/site- > packages/mpl_toolkits/mplot3d/art3d.py", line 369, in > poly_collection_2d_to_3d > segments_3d = paths_to_3d_segments(col.get_paths(), zs, zdir) > > File > "/Library/Frameworks/Python.framework/Versions/4.2.30201/lib/python2.5/site- > packages/mpl_toolkits/mplot3d/art3d.py", line 138, in paths_to_3d_segments > segments.append(path_to_3d_segment(path, pathz, zdir)) > > File > "/Library/Frameworks/Python.framework/Versions/4.2.30201/lib/python2.5/site- > packages/mpl_toolkits/mplot3d/art3d.py", line 122, in path_to_3d_segment > pathsegs = path.iter_segments(simplify=False, curves=False) > TypeError: iter_segments() got an unexpected keyword argument 'curves' > Huh, that is a very interesting and unexpected point for the interpreter to complain. I have the same lines on installation and it works without any problem. One last idea, you could try to isolate your matplotlib installation from Enthought's distro and try again, while having a separate Python, too. Someone in the list with more experience might have more to say on this issue. |
|
From: Michael D. <md...@st...> - 2009-07-01 20:03:03
|
This should now be fixed on the maintenance branch and trunk. A Numpy
array allocation was not being NULL-checked in _path.cpp:affine_transform.
I know a MemoryError doesn't help the user much more than a segfault,
but it always makes me feel better to get a real Python exception rather
than exploding ;)
Mike
On 07/01/2009 03:16 PM, Jae-Joon Lee wrote:
> On Wed, Jul 1, 2009 at 2:34 PM, Michael Droettboom<md...@st...> wrote:
>
>> I agree with Jae-Joon here -- try to reduce the number of points before
>> passing it to matplotlib.
>>
>> However, I'm a little concerned about the segfault -- I'd rather matplotlib
>> give a MemoryError exception if that's in fact what is happening. Jae-Joon
>> -- can you share your test that causes the segfault?
>>
>> The snippet below completely hogs my machine for a few minutes, but then,
>> correctly, aborts with a MemoryError.
>>
>> This is on FC11 i586, Python 2.6, Numpy 1.3.
>>
>> ====
>>
>> from matplotlib.pyplot import *
>> import numpy as np
>>
>> points = np.random.random((50000000, 2))
>> plot(points)
>> show()
>>
>>
>
> Yes, I also got MemoryError in this case during the plot() call.
>
> But I got segfault for the code below.
>
> x=random(50e6)
> y=random(50e6)
> plt.plot(x, y)
> plt.show()
>
> In this case, plot() runs fine, but segfault during show().
>
> The segfault happens in the _path_module::affine_transform method of
> src/_path.cpp.
>
> I wonder if you can reproduce this.
>
> -JJ
>
>
>
>> ====
>>
>> Mike
>>
>> On 07/01/2009 01:34 PM, Jae-Joon Lee wrote:
>>
>> A snippet of code does not help much.
>> Please try to post a small concise standalone example that we can run and
>> test.
>>
>> A general advise is to try to reduce the number of plot call, i.e.,
>> plot as may points as possible with a single plot call.
>>
>> However, 50million points seems to be awful a lot.
>> 6 inch x 6 inch figure with dpi=100 has 0.36 million number of pixels.
>> My guess is that it makes little sense to plot 50 million points here.
>>
>> Anyhow, plotting 50million points with a single plot call dies with
>> some segfault error in my machine. So, I feel that matplotlib may not
>> be suitable for your task. But, John or others may have some insight
>> how to deal with.
>>
>> Regards,
>>
>> -JJ
>>
>>
>>
>> On Tue, Jun 30, 2009 at 1:22 PM, Markus Feldmann<fel...@gm...>
>> wrote:
>>
>>
>> Hi All,
>>
>> my program lets slow down my cpu. This only appears if i plot to much
>> points. I am not sure how many point i need to get this, normally i plot
>> 3*14e6 + 8e3, that is round about 50million points. My system is a
>> dual core 2GHz cpu with 2Gbyte Ram.
>>
>> Here is my method to plot,
>> def drawtransientall(self,min):
>> self.subplot = self.figure.add_subplot(111)
>> self.subplot.grid(True)
>> list_t1,list_peaks,t2,list_samples =
>> self.computetransientall(min,min+self.maxitems)
>> offset = 0
>> color = ['green','red','blue','magenta','cyan']
>> markerPeaks = ['v','<','1','3','s']
>> markerSamples = ['^','>','2','4','p']
>> self.plots=[[],[]]
>> for i in range(len(self.showBands)):
>> self.plots[0] +=
>> self.subplot.plot(list_t1[i],list_peaks[i],color=color[i],marker=markerPeaks[i],
>> linestyle='None')
>> self.plots[1] +=
>> self.subplot.plot(t2,list_samples[i]+offset,color=color[i],
>>
>> marker=markerSamples[i],linestyle='None')
>> offset +=1
>>
>> self.subplot.set_xlim(t2[0]-np.abs(t2[-1]-t2[0])/100,t2[-1]+np.abs(t2[-1]-t2[0])/100)
>> ymax = np.amax(list_samples)
>> ymin = np.amin(list_samples)
>> self.subplot.set_ylim([ymin-np.abs(ymin)*0.1, ymax*1.2 + 2])
>> self.subplot.set_ylabel("abs(Sample(t)) und
>> abs(Peak(t)+Offset)-->",fontsize = 12)
>> self.subplot.set_xlabel("Zeit in Sek. -->",fontsize = 12)
>>
>> Any ideas how to avoid the slow down of my cpu ?
>>
>> regards Markus
>>
>>
>> ------------------------------------------------------------------------------
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>>
>>
>> ------------------------------------------------------------------------------
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>>
>>
|
|
From: Jae-Joon L. <lee...@gm...> - 2009-07-01 19:53:18
|
I tracked this down do line 962 of the _path.cpp.
double* vertex_out = (double*)PyArray_DATA(result);
My guess is that PyArray_SimpleNew at line 957 returns NULL for a
memory error instead of raising an exception, which makes result=NULL
and causes a segfault at line 962.
Since I'm not an c++ expert, I'll leave it to you, Michael.
Regards,
-JJ
On Wed, Jul 1, 2009 at 3:16 PM, Jae-Joon Lee<lee...@gm...> wrote:
> On Wed, Jul 1, 2009 at 2:34 PM, Michael Droettboom<md...@st...> wrote:
>> I agree with Jae-Joon here -- try to reduce the number of points before
>> passing it to matplotlib.
>>
>> However, I'm a little concerned about the segfault -- I'd rather matplotlib
>> give a MemoryError exception if that's in fact what is happening. Jae-Joon
>> -- can you share your test that causes the segfault?
>>
>> The snippet below completely hogs my machine for a few minutes, but then,
>> correctly, aborts with a MemoryError.
>>
>> This is on FC11 i586, Python 2.6, Numpy 1.3.
>>
>> ====
>>
>> from matplotlib.pyplot import *
>> import numpy as np
>>
>> points = np.random.random((50000000, 2))
>> plot(points)
>> show()
>>
>
> Yes, I also got MemoryError in this case during the plot() call.
>
> But I got segfault for the code below.
>
> x=random(50e6)
> y=random(50e6)
> plt.plot(x, y)
> plt.show()
>
> In this case, plot() runs fine, but segfault during show().
>
> The segfault happens in the _path_module::affine_transform method of
> src/_path.cpp.
>
> I wonder if you can reproduce this.
>
> -JJ
>
>
>> ====
>>
>> Mike
>>
>> On 07/01/2009 01:34 PM, Jae-Joon Lee wrote:
>>
>> A snippet of code does not help much.
>> Please try to post a small concise standalone example that we can run and
>> test.
>>
>> A general advise is to try to reduce the number of plot call, i.e.,
>> plot as may points as possible with a single plot call.
>>
>> However, 50million points seems to be awful a lot.
>> 6 inch x 6 inch figure with dpi=100 has 0.36 million number of pixels.
>> My guess is that it makes little sense to plot 50 million points here.
>>
>> Anyhow, plotting 50million points with a single plot call dies with
>> some segfault error in my machine. So, I feel that matplotlib may not
>> be suitable for your task. But, John or others may have some insight
>> how to deal with.
>>
>> Regards,
>>
>> -JJ
>>
>>
>>
>> On Tue, Jun 30, 2009 at 1:22 PM, Markus Feldmann<fel...@gm...>
>> wrote:
>>
>>
>> Hi All,
>>
>> my program lets slow down my cpu. This only appears if i plot to much
>> points. I am not sure how many point i need to get this, normally i plot
>> 3*14e6 + 8e3, that is round about 50million points. My system is a
>> dual core 2GHz cpu with 2Gbyte Ram.
>>
>> Here is my method to plot,
>> def drawtransientall(self,min):
>> self.subplot = self.figure.add_subplot(111)
>> self.subplot.grid(True)
>> list_t1,list_peaks,t2,list_samples =
>> self.computetransientall(min,min+self.maxitems)
>> offset = 0
>> color = ['green','red','blue','magenta','cyan']
>> markerPeaks = ['v','<','1','3','s']
>> markerSamples = ['^','>','2','4','p']
>> self.plots=[[],[]]
>> for i in range(len(self.showBands)):
>> self.plots[0] +=
>> self.subplot.plot(list_t1[i],list_peaks[i],color=color[i],marker=markerPeaks[i],
>> linestyle='None')
>> self.plots[1] +=
>> self.subplot.plot(t2,list_samples[i]+offset,color=color[i],
>>
>> marker=markerSamples[i],linestyle='None')
>> offset +=1
>>
>> self.subplot.set_xlim(t2[0]-np.abs(t2[-1]-t2[0])/100,t2[-1]+np.abs(t2[-1]-t2[0])/100)
>> ymax = np.amax(list_samples)
>> ymin = np.amin(list_samples)
>> self.subplot.set_ylim([ymin-np.abs(ymin)*0.1, ymax*1.2 + 2])
>> self.subplot.set_ylabel("abs(Sample(t)) und
>> abs(Peak(t)+Offset)-->",fontsize = 12)
>> self.subplot.set_xlabel("Zeit in Sek. -->",fontsize = 12)
>>
>> Any ideas how to avoid the slow down of my cpu ?
>>
>> regards Markus
>>
>>
>> ------------------------------------------------------------------------------
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>>
>>
>> ------------------------------------------------------------------------------
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>>
>
|
|
From: Jae-Joon L. <lee...@gm...> - 2009-07-01 19:17:23
|
On Wed, Jul 1, 2009 at 2:34 PM, Michael Droettboom<md...@st...> wrote:
> I agree with Jae-Joon here -- try to reduce the number of points before
> passing it to matplotlib.
>
> However, I'm a little concerned about the segfault -- I'd rather matplotlib
> give a MemoryError exception if that's in fact what is happening. Jae-Joon
> -- can you share your test that causes the segfault?
>
> The snippet below completely hogs my machine for a few minutes, but then,
> correctly, aborts with a MemoryError.
>
> This is on FC11 i586, Python 2.6, Numpy 1.3.
>
> ====
>
> from matplotlib.pyplot import *
> import numpy as np
>
> points = np.random.random((50000000, 2))
> plot(points)
> show()
>
Yes, I also got MemoryError in this case during the plot() call.
But I got segfault for the code below.
x=random(50e6)
y=random(50e6)
plt.plot(x, y)
plt.show()
In this case, plot() runs fine, but segfault during show().
The segfault happens in the _path_module::affine_transform method of
src/_path.cpp.
I wonder if you can reproduce this.
-JJ
> ====
>
> Mike
>
> On 07/01/2009 01:34 PM, Jae-Joon Lee wrote:
>
> A snippet of code does not help much.
> Please try to post a small concise standalone example that we can run and
> test.
>
> A general advise is to try to reduce the number of plot call, i.e.,
> plot as may points as possible with a single plot call.
>
> However, 50million points seems to be awful a lot.
> 6 inch x 6 inch figure with dpi=100 has 0.36 million number of pixels.
> My guess is that it makes little sense to plot 50 million points here.
>
> Anyhow, plotting 50million points with a single plot call dies with
> some segfault error in my machine. So, I feel that matplotlib may not
> be suitable for your task. But, John or others may have some insight
> how to deal with.
>
> Regards,
>
> -JJ
>
>
>
> On Tue, Jun 30, 2009 at 1:22 PM, Markus Feldmann<fel...@gm...>
> wrote:
>
>
> Hi All,
>
> my program lets slow down my cpu. This only appears if i plot to much
> points. I am not sure how many point i need to get this, normally i plot
> 3*14e6 + 8e3, that is round about 50million points. My system is a
> dual core 2GHz cpu with 2Gbyte Ram.
>
> Here is my method to plot,
> def drawtransientall(self,min):
> self.subplot = self.figure.add_subplot(111)
> self.subplot.grid(True)
> list_t1,list_peaks,t2,list_samples =
> self.computetransientall(min,min+self.maxitems)
> offset = 0
> color = ['green','red','blue','magenta','cyan']
> markerPeaks = ['v','<','1','3','s']
> markerSamples = ['^','>','2','4','p']
> self.plots=[[],[]]
> for i in range(len(self.showBands)):
> self.plots[0] +=
> self.subplot.plot(list_t1[i],list_peaks[i],color=color[i],marker=markerPeaks[i],
> linestyle='None')
> self.plots[1] +=
> self.subplot.plot(t2,list_samples[i]+offset,color=color[i],
>
> marker=markerSamples[i],linestyle='None')
> offset +=1
>
> self.subplot.set_xlim(t2[0]-np.abs(t2[-1]-t2[0])/100,t2[-1]+np.abs(t2[-1]-t2[0])/100)
> ymax = np.amax(list_samples)
> ymin = np.amin(list_samples)
> self.subplot.set_ylim([ymin-np.abs(ymin)*0.1, ymax*1.2 + 2])
> self.subplot.set_ylabel("abs(Sample(t)) und
> abs(Peak(t)+Offset)-->",fontsize = 12)
> self.subplot.set_xlabel("Zeit in Sek. -->",fontsize = 12)
>
> Any ideas how to avoid the slow down of my cpu ?
>
> regards Markus
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
|
|
From: Michael D. <md...@st...> - 2009-07-01 18:34:37
|
I agree with Jae-Joon here -- try to reduce the number of points before
passing it to matplotlib.
However, I'm a little concerned about the segfault -- I'd rather
matplotlib give a MemoryError exception if that's in fact what is
happening. Jae-Joon -- can you share your test that causes the segfault?
The snippet below completely hogs my machine for a few minutes, but
then, correctly, aborts with a MemoryError.
This is on FC11 i586, Python 2.6, Numpy 1.3.
====
from matplotlib.pyplot import *
import numpy as np
points = np.random.random((50000000, 2))
plot(points)
show()
====
Mike
On 07/01/2009 01:34 PM, Jae-Joon Lee wrote:
> A snippet of code does not help much.
> Please try to post a small concise standalone example that we can run and test.
>
> A general advise is to try to reduce the number of plot call, i.e.,
> plot as may points as possible with a single plot call.
>
> However, 50million points seems to be awful a lot.
> 6 inch x 6 inch figure with dpi=100 has 0.36 million number of pixels.
> My guess is that it makes little sense to plot 50 million points here.
>
> Anyhow, plotting 50million points with a single plot call dies with
> some segfault error in my machine. So, I feel that matplotlib may not
> be suitable for your task. But, John or others may have some insight
> how to deal with.
>
> Regards,
>
> -JJ
>
>
>
> On Tue, Jun 30, 2009 at 1:22 PM, Markus Feldmann<fel...@gm...> wrote:
>
>> Hi All,
>>
>> my program lets slow down my cpu. This only appears if i plot to much
>> points. I am not sure how many point i need to get this, normally i plot
>> 3*14e6 + 8e3, that is round about 50million points. My system is a
>> dual core 2GHz cpu with 2Gbyte Ram.
>>
>> Here is my method to plot,
>> def drawtransientall(self,min):
>> self.subplot = self.figure.add_subplot(111)
>> self.subplot.grid(True)
>> list_t1,list_peaks,t2,list_samples =
>> self.computetransientall(min,min+self.maxitems)
>> offset = 0
>> color = ['green','red','blue','magenta','cyan']
>> markerPeaks = ['v','<','1','3','s']
>> markerSamples = ['^','>','2','4','p']
>> self.plots=[[],[]]
>> for i in range(len(self.showBands)):
>> self.plots[0] +=
>> self.subplot.plot(list_t1[i],list_peaks[i],color=color[i],marker=markerPeaks[i],
>> linestyle='None')
>> self.plots[1] +=
>> self.subplot.plot(t2,list_samples[i]+offset,color=color[i],
>>
>> marker=markerSamples[i],linestyle='None')
>> offset +=1
>>
>> self.subplot.set_xlim(t2[0]-np.abs(t2[-1]-t2[0])/100,t2[-1]+np.abs(t2[-1]-t2[0])/100)
>> ymax = np.amax(list_samples)
>> ymin = np.amin(list_samples)
>> self.subplot.set_ylim([ymin-np.abs(ymin)*0.1, ymax*1.2 + 2])
>> self.subplot.set_ylabel("abs(Sample(t)) und
>> abs(Peak(t)+Offset)-->",fontsize = 12)
>> self.subplot.set_xlabel("Zeit in Sek. -->",fontsize = 12)
>>
>> Any ideas how to avoid the slow down of my cpu ?
>>
>> regards Markus
>>
>>
>> ------------------------------------------------------------------------------
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
|
|
From: Jae-Joon L. <lee...@gm...> - 2009-07-01 17:34:20
|
A snippet of code does not help much.
Please try to post a small concise standalone example that we can run and test.
A general advise is to try to reduce the number of plot call, i.e.,
plot as may points as possible with a single plot call.
However, 50million points seems to be awful a lot.
6 inch x 6 inch figure with dpi=100 has 0.36 million number of pixels.
My guess is that it makes little sense to plot 50 million points here.
Anyhow, plotting 50million points with a single plot call dies with
some segfault error in my machine. So, I feel that matplotlib may not
be suitable for your task. But, John or others may have some insight
how to deal with.
Regards,
-JJ
On Tue, Jun 30, 2009 at 1:22 PM, Markus Feldmann<fel...@gm...> wrote:
> Hi All,
>
> my program lets slow down my cpu. This only appears if i plot to much
> points. I am not sure how many point i need to get this, normally i plot
> 3*14e6 + 8e3, that is round about 50million points. My system is a
> dual core 2GHz cpu with 2Gbyte Ram.
>
> Here is my method to plot,
> def drawtransientall(self,min):
> self.subplot = self.figure.add_subplot(111)
> self.subplot.grid(True)
> list_t1,list_peaks,t2,list_samples =
> self.computetransientall(min,min+self.maxitems)
> offset = 0
> color = ['green','red','blue','magenta','cyan']
> markerPeaks = ['v','<','1','3','s']
> markerSamples = ['^','>','2','4','p']
> self.plots=[[],[]]
> for i in range(len(self.showBands)):
> self.plots[0] +=
> self.subplot.plot(list_t1[i],list_peaks[i],color=color[i],marker=markerPeaks[i],
> linestyle='None')
> self.plots[1] +=
> self.subplot.plot(t2,list_samples[i]+offset,color=color[i],
>
> marker=markerSamples[i],linestyle='None')
> offset +=1
>
> self.subplot.set_xlim(t2[0]-np.abs(t2[-1]-t2[0])/100,t2[-1]+np.abs(t2[-1]-t2[0])/100)
> ymax = np.amax(list_samples)
> ymin = np.amin(list_samples)
> self.subplot.set_ylim([ymin-np.abs(ymin)*0.1, ymax*1.2 + 2])
> self.subplot.set_ylabel("abs(Sample(t)) und
> abs(Peak(t)+Offset)-->",fontsize = 12)
> self.subplot.set_xlabel("Zeit in Sek. -->",fontsize = 12)
>
> Any ideas how to avoid the slow down of my cpu ?
>
> regards Markus
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
|
|
From: Jae-Joon L. <lee...@gm...> - 2009-07-01 16:55:22
|
yscale("log")
http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.yscale
However the bars in the stem plot will be gone (because of the log 0).
It seems that there is no option for controling the baseline location
in the stem command.
However, the code for stem command is quite short (~10 lines), so I
guess you can easily modify it to your taste.
Regards,
-JJ
On Wed, Jul 1, 2009 at 8:41 AM, Forrest Sheng Bao<for...@gm...> wrote:
> Him
>
> I had a stem plot. Now I want to make the Y axis of log scale. But I do not
> want to use semilogy since I prefer the bars in stem plot. Do you know how
> to only scale the Y axis?
>
> Cheers,
> Forrest
>
> Forrest Sheng Bao, BSEE, Graduate Student
> Dept. of Computer Science/Electrical Engineering
> Texas Tech University, Lubbock, Texas
> http://narnia.cs.ttu.edu
>
> ------------------------------------------------------------------------------
>
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
|
|
From: Gökhan S. <gok...@gm...> - 2009-07-01 16:29:57
|
On Wed, Jul 1, 2009 at 9:55 AM, David Paulsen<dav...@du...> wrote: > Dear List, > > I tried running examples of 3D plots given from the matplotlib webpage, but > encountered the following error: > > > from mpl_toolkits.mplot3d import Axes3D > ImportError: No module named mplot3d > > I am using the enthought package with matplotlib version 0.98.5.2 > > Any help on how to recover mplot 3d would be appreciated. > > Thanks, > david > > > David Paulsen, M.S. > Graduate Student > Department of Psychology & Neuroscience > Duke University > > ------------------------------------------------------------------------------ > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > Hello, mplot3d module is in the svn codebase. You will have to check-out the sources and make a manual installation. If you are on linux, it is a very easy process: First a check-out with svn svn co https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/trunk/matplotlib matplotlib and then python setup.py install Tadaa, the examples should work without any problems. Gökhan |
|
From: Mark L. <lar...@gm...> - 2009-07-01 15:41:35
|
> I think what you want is > > ax = fig.add_subplot(111,frameon=False) > > JLS D'oh, I knew it had to be easy. Thanks JLS. |