[matplotlib-devel] matplotlib and numpy cause MemoryError

2009-11-18 Thread Mathew Yeates
Hi

I have a line of matplotlib code

-self.ax.plot(plot_data,mif)



that causes the line

-self.data=numpy.zeros(shape=dims) #dims is a constant, not large



to throw a MemoryError exception.

(if I comment out the first line I get no error.)

Is it possible that matplotlib is dereferencing an array somewhere?

This is on a windows xp machine with latest numpy and the latest matplotlib.



I have a feeling this may be a nightmare to figure out what matplotlib
and/or numpy are doing wrong. Any ideas where I can start?



Mathew
--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


[matplotlib-devel] matplotlib is breaking numpy

2009-11-19 Thread Mathew Yeates
There is definitely something wrong with matplotlib/numpy. Consider the
following
>from numpy import *
>mydata=memmap('map.dat',dtype=float64,mode='w+',shape=56566500)
> del mydata

I can now remove the file map.dat with (from the command line) $rm map.dat

However
If I plot  mydata before the line
> del mydata


I can't get rid of the file until I exit python!!
Does matplotlib keep a reference to the data? How can I remove this
reference?

Mathew
--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


[matplotlib-devel] matplotlib is breaking numpy

2009-11-30 Thread Mathew Yeates
Here is sample code demonstrating the problem I'm having with
pyhd5/numpy/matplotlib

import h5py
import numpy
import re

import sys
import os
import gtk
import pdb
import gc

from matplotlib.figure import Figure
from matplotlib.backends.backend_gtkagg import FigureCanvasGTKAgg as
FigureCanvas




def doplot(widget,box1):
id=h5py.h5f.open("MLS-Aura_L1BRADD_v02-23-c01_2009d001.h5")
data_id = h5py.h5d.open(id,"R1A:118.B22D:PT.S0.DACS-4")
dataspaceID = h5py.h5d.DatasetID.get_space(data_id)
noDims = h5py.h5s.SpaceID.get_simple_extent_ndims(dataspaceID)
dims  = h5py.h5s.SpaceID.get_simple_extent_dims(dataspaceID)
start=tuple([0]*noDims)
h5py.h5s.SpaceID.select_hyperslab(dataspaceID,start,dims,None,None,
h5py.h5s.SELECT_SET)
memory_space_id = h5py.h5s.create_simple(dims)
data=numpy.memmap('tmpdat',dtype=numpy.float64,mode='w+',shape=dims)
h5py.h5d.DatasetID.read(data_id,memory_space_id,dataspaceID,data)
del data
data=numpy.memmap('tmpdat',dtype=numpy.float64,mode='r',shape=dims)

fig = Figure(figsize=(5,5), dpi=100)
ax = fig.add_subplot(111)
plot_data=data[0,0:,0]
mif=numpy.arange(plot_data.shape[0])
#if the next line is commented out, all is good
ax.plot(plot_data,mif)
canvas = FigureCanvas(fig)
box1.pack_start(canvas, True, True, 0)
canvas.show()
id.close()
del data
del fig
del ax
del plot_data
del canvas
gc.collect()
#the following line fails
os.remove('tmpdat')

def delete_event(widget, event, data=None):
return False

window = gtk.Window(gtk.WINDOW_TOPLEVEL)
window.connect("destroy", lambda x: gtk.main_quit())
box1 = gtk.HBox(False, 0)
window.add(box1)


button = gtk.Button("Hello World")
box1.pack_start(button, True, True, 0)
#window.add(box1)
button.show()
button.connect("clicked", doplot, box1)
box1.show()
window.set_default_size(500,400)

window.show()
gtk.main()
--
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


[matplotlib-devel] 3d support

2008-02-01 Thread Mathew Yeates
Hi
I want to write an application which includes multidimensional 
visualization. I tried running simple3d.py but it is sloww! Also, 
I'm not sure if the Navigation Toolbar is working properly.

I looked into VTK and it certainly has good performance and good 
navigation but  another steep learning and probably overkill for 
interacting with simple 3d plots.

Anyone have any thoughts on this?

Mathew


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] 3d support

2008-02-01 Thread Mathew Yeates
I was just experimenting with Mayavi2 when your mail arrived! Thanks. 
I'll look at it over the weekend

Mathew

Gael Varoquaux wrote:
> On Fri, Feb 01, 2008 at 02:47:21PM -0800, Mathew Yeates wrote:
>   
>> I looked into VTK and it certainly has good performance and good 
>> navigation but  another steep learning and probably overkill for 
>> interacting with simple 3d plots.
>> 
>
>   
>> Anyone have any thoughts on this?
>> 
>
> We are working on making Mayavi2
> (https://svn.enthought.com/enthought/wiki/MayaVi) suitable for what you
> want to do. You can have a look at http://gael-varoquaux.info/blog/?p=3
> for a demo of the capabilities and the interface. This is only part of
> Mayavi2, as Mayavi2 also provides a fully-fledged visualisation
> application.
>
> Mayavi2 is based upon VTK but strives to make it interactive and to
> provide a simple API. It is still in flux and documentation is sparse (I
> am planning to address this problem this week end). Moreover some people
> find installation painful. We are working on that and in the mean time we
> are very willing to help people if they have difficulties with the
> instructions on the webpage. If you want more info or help of any kind,
> the relevant mailing list is
> https://mail.enthought.com/mailman/listinfo/enthought-dev .
>
> HTH,
>
> Gaƫl
>
>   



-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel