Leandro Lameiro | 1 Jul 2006 19:57
Picon

Big slowdown showing PNG images

Hello.

I had a piece of code working perfectly fine with matplotlib 0.87.2.
Now I updated to 0.87.3 and it is about 100 times slower (!).

The code shows a PNG image using axes.imshow.

<code>

from pylab import *
from time import asctime, time
import Image

PNG_file='foo.png'
fh=figure()
ax = fh.add_subplot(111)
print 'Image intepolation = %s' % rcParams['image.interpolation']
print 'Image aspect       = %s' % rcParams['image.aspect']
print 'Date/Time          = %s' % asctime()
t1=time()

print "Starting Image.open"
image = Image.open(PNG_file)
print "Image.open terminated"

print "Starting imshow"
ax.imshow(image, origin='lower')
print "imshow terminated"

setp(ax.get_xticklabels(), visible=False)
(Continue reading)

Zhang Le | 2 Jul 2006 21:16
Picon

ion, draw and show?

Hi,
  I have some confusion about ion/ioff, draw() and show().  After
drawing a figure I need to make it show up on the screen without
calling show() and entering the main loop. Here's the code that works:
ion()
l = plot(arange(10),2.*arange(10))
draw()
raw_input('pause')

However, if I remove ion() or place ion() after the plot() or draw()
commands, no figure is shown on the screen. This sucks because any
operation after ion() will be significantly slowed down before a call
to ioff(). I'm not sure if it's a bug that draw() does not update the
screen in ioff() mode.

Any tips?
Zhang Le

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
jules hummon | 2 Jul 2006 22:09
Favicon

matlab-like "children" of axes?

Hello all

My specific question is this:

Suppose I have a figure, with an axes object, and an XY plot:

#-------
import matplotlib
import pylab as P

t = P.arange(0.0,1.0,0.02)
x = P.sin(2*P.pi*t)
y = P.exp(-t*3.)*P.cos(3*P.pi*t)

ff = P.Figure(figsize=(5,4), dpi=100)
ss = P.subplot(222)
pp = ss.plot(x,y,'.-')

# some program resets x,y limits
P.show()
#-----

(Sorry for my matlab-tainted language):

I would like to use ff.gca() to get the handle of the
active axes object (which should be ss) and then
determine the indices into the original data (x,y)
which reflect the points showing in the current
axis limits (whatever they have been set to)

(Continue reading)

PGM | 2 Jul 2006 22:58
Picon

Re: matlab-like "children" of axes?

Jules,
>
> ff = P.Figure(figsize=(5,4), dpi=100)
> ss = P.subplot(222)
> pp = ss.plot(x,y,'.-')
>
> # some program resets x,y limits
> P.show()
> #-----

> Is there any way to
> - find the axes objects that count "ff" as their parent?

The `figure` associated with a subplot object `ss` is `ss.figure`
The list of axes objects associated with a figure `ff` is ff.axes.
So, you should be able to access the subplots as 
ss.figure.axes

> - access the x,y points as "children" of the axes object ss?
Try something like
pp.get_xdata(), pp.get_ydata()
where pp is the output of ss.plot

IMHO, it'd be easier to go:
ff = P.figure()
ss = ff.add_subplot(222)
pp = ss.plot(x,y,'.-')

You can check that id(ff.axes[0])==id(ss)

(Continue reading)

Fernando Perez | 3 Jul 2006 00:43
Picon
Gravatar

Re: matplotlib setup.py failing

On 6/30/06, Belkind, Ronnen <Ronnen.Belkind@...> wrote:
>
>
>
> I downlaoded matplotlib-0.87.3.tar.gz from sourceforge and am attempting to
> compile/install it on a RedHat linux installation source.  When I run setup
> I get the following error.
>
> $: python setup.py build
> Traceback (most recent call last):
>   File "setup.py", line 63, in ?
>     from setupext import build_agg, build_gtkagg, build_tkagg, build_wxagg,\
>   File "setupext.py", line 118, in ?
>     win32_compiler = get_win32_compiler()
>   File "setupext.py", line 115, in get_win32_compiler
>     if 'mingw32' in v:
> TypeError: 'in <string>' requires character as left operand
>
>
> I'm runing python 2.2.3.  libpng, zlib, freetype, and Numeric are all
> installed.
> Any suggestions are greatly appreciated.

This error is 2.2 specific:

littlewood[~]> python
Python 2.2.2 (#1, Feb 24 2003, 19:13:11)
[GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 'ab' in 'abcde'
(Continue reading)

Nils Wagner | 3 Jul 2006 10:31
Picon

AttributeError: TextWithDash instance has no attribute '_mytext'

 Hi all,

I tried to reproduce the Contour3D plot  
http://www.scipy.org/Cookbook/Matplotlib/mplot3D.

from numpy import *
import pylab as p
import mpl3d.mplot3d as p3

p.matplotlib.__version__
# in mplt3D change:
# levels, colls = self.contour(X, Y, Z, 20)
# to:
# C = self.contour(X, Y, Z, *args, **kwargs)
# levels, colls = (C.levels, C.collections)

delta = 0.025
x = arange(-3.0, 3.0, delta)
y = arange(-2.0, 2.0, delta)
X, Y = p.meshgrid(x, y)
Z1 = p.bivariate_normal(X, Y, 1.0, 1.0, 0.0, 0.0)
Z2 = p.bivariate_normal(X, Y, 1.5, 0.5, 1, 1)
# difference of Gaussians
Z = 10.0 * (Z2 - Z1)
fig=p.figure()
ax = p3.Axes3D(fig)
ax.contour3D(X,Y,Z)
ax.set_xlabel('X')
ax.set_ylabel('Y')
ax.set_zlabel('Z')
(Continue reading)

Bryan Cole | 3 Jul 2006 21:23
Favicon

Re: skencil backend

On Fri, 2006-06-30 at 08:28 +0000, Christian Kristukat wrote:
> Hi,
> I'd love to have a backend which outputs skencil .sk files with text rendered
> through the skLaTeX plugin. For those who don't know it, skencil is a vector
> drawing program written in python. Its skLaTeX plugin allows to include LaTeX
> text in the drawing. Right now I'm creating eps files with matplotlib with the
> 'xpdf' distiller option and convert it to skencil file format with pstoedit
> which works but which is not very convenient.

you could try using the matplotlib SVG backend. Skencil can import SVG,
although skencil can only use the old X-style font system, so my plots
(which use Bitstream Vera fonts by default) didn't look too nice. You
could fix this by setting more compatible fonts in the matplotlibrc
presumably.

Alternatively, you could try Inkscape in place of Skencil for editing
SVG files. Inkscape can print to PS/EPS/AI for inclusion in a LateX or
skencil document (.ai). It can optionaly convert text to paths, avoiding
the font problems.

BC

> Has anybody already done something like that before? I don't know if I'll find
> the time to try it myself. In case not, please accept it as feature request.
> Christian
> 
> 
> 
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
(Continue reading)

Michael J.T. O'Kelly | 4 Jul 2006 01:20
Picon
Favicon

Problem upgrading to 87.3

I get a mysterious problem when I try to upgrade from 87.2 to 87.3.

At first it complained of a bad configuration file. Once that was 
corrected, though, matplotlib still crashes Python as soon as "import 
pylab" or "import matplotlib" is called. No message of any kind is passed.

The Windows error report says the exception was in multiarray.pyd.  I 
can reinstall 87.2 and everything is fine.  Any idea what the problem 
might be?

Thanks!

--Michael

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
Charlie Moad | 4 Jul 2006 02:15
Picon

Re: Problem upgrading to 87.3

Sounds like you need to upgrade numpy to 0.9.8.

- Charlie

On 7/3/06, Michael J.T. O'Kelly <mokelly@...> wrote:
> I get a mysterious problem when I try to upgrade from 87.2 to 87.3.
>
> At first it complained of a bad configuration file. Once that was
> corrected, though, matplotlib still crashes Python as soon as "import
> pylab" or "import matplotlib" is called. No message of any kind is passed.
>
> The Windows error report says the exception was in multiarray.pyd.  I
> can reinstall 87.2 and everything is fine.  Any idea what the problem
> might be?
>
>
> Thanks!
>
> --Michael
>
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users@...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>

(Continue reading)

Michael J.T. O'Kelly | 4 Jul 2006 03:08
Picon
Favicon

Re: Problem upgrading to 87.3

You're quite right.  Thank you.

Charlie Moad wrote:

> Sounds like you need to upgrade numpy to 0.9.8.
> 
> - Charlie

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

Gmane