Re: [Matplotlib-users] showing current value on boxplot

2009-08-25 Thread Jouni K . Seppänen
Ravi A. ravi.ara...@gmail.com writes:

 I am using boxplot and i wanted to mark current value or any special value
 on the box plot. How do i achieve this? Something like below.

Just plot the special value, with hold=True if you have set the hold
default to false. One small issue is that plot autoscales the view
tightly, which looks bad with the boxes, so you may want to nudge it a
bit:

from pylab import *
boxplot(random((10,10)))
plot(arange(1,11), random(10), 'rx', ms=5, mew=2, hold=True)
a,b = xlim()
xlim(a-.5,b+.5)
show()

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
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-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Custom ticklabels on colorbar

2009-08-25 Thread Daniel Platz
Jae-Joon Lee wrote:
 On Fri, Aug 21, 2009 at 10:01 AM, Scott
 Sinclairscott.sinclair...@gmail.com wrote:
 I just realized that I did not give the correct plot object when creating
 the colorbar. Now it works perfectly to pass arguments by set_xticklabels().

 However, another question just arose. To format the numbers on the tick
 labels I tried to pass a format string when creating the colorbar with the
 format parameter. But it has no effect. The same when I give a
 FormatStrFormatter object. I also tried to use
 cb.ax.axis.set_major_formatter(). The effect of this was. That it sets the
 labels to the range between 0 and 1. Is there a solution for this problem
 besides entering the tick labels manually?
 
 The tick locator and tick formatter needs to be passed during the
 colorbar creation. Otherwise,
 it gets very tricky to deal with. This is because the data coordinate
 of the colorbar axes is not directly associated with the ticklabels.
 
 If passing the formatter during the colorbar creation has no effect,
 this should be filed as a bug. Please post a small standalone example
 that reproduces your problem. Also, please report your version of
 matplotlib. If you're using older version, I recommend you to test it
 with newer version.
 
 Just in case, my quick test worked fine.
 
 imshow([[1,2],[2,3]])
 cb=colorbar(format=r$%2.1f\%%$)
 
 -JJ
 

I just tried this but it did not work for me. The code that I am using 
looks like this

 ax1 = fig1.add_subplot(3,len(fname)/2,i+1,frameon=False)
 temp = np.linspace(data1_amp.min(),data1_amp.max(),3)
 pc1 = ax1.imshow(data1_amp,cmap=nat,vmin=temp[0],vmax=temp[-1])
 ax1.set_xlim((0,250))
 ax1.set_ylim((0,256))
 ax1.set_xticks([])
 ax1.set_yticks([])
 ax1.set_xticklabels('')
 ax1.set_yticklabels('')
 if i==0:
 ax1.set_ylabel('Amplitude 
[mV]',family='serif',size=10,weight='bold')
 ax1.set_title(title[i],family='serif',fontsize=10,weight='bold')
 cb1 = 
fig1.colorbar(pc1,ax=ax1,orientation='horizontal',pad=0.025,ticks=temp,format=r$%2.1f\%%$)
 cb1.ax.set_xticklabels(temp,fontsize=10,family='serif')
 setp(cb1.ax.get_xticklines(),visible=False)
 plt.draw()
 a= ax1.get_position().get_points()
 b= cb1.ax.get_position().get_points()
 temp = [a[0,0], b[0,1], (a[1,0]-a[0,0]), (b[1,1]-b[0,1])]
 cb1.ax.set_position(temp)

I am using matplotlib 0.98.5.2. If anyone has an idea I would be very 
glad if you can post here.

Thanks in advance

Daniel



--
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-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] showing current value on boxplot

2009-08-25 Thread Ravi A.

Worked like a charm. Thank you very much!
I really appreciate the sample code and teaching by example.


Jouni K. Seppänen wrote:
 
 Ravi A. ravi.ara...@gmail.com writes:
 
 I am using boxplot and i wanted to mark current value or any special
 value
 on the box plot. How do i achieve this? Something like below.
 
 Just plot the special value, with hold=True if you have set the hold
 default to false. One small issue is that plot autoscales the view
 tightly, which looks bad with the boxes, so you may want to nudge it a
 bit:
 
 from pylab import *
 boxplot(random((10,10)))
 plot(arange(1,11), random(10), 'rx', ms=5, mew=2, hold=True)
 a,b = xlim()
 xlim(a-.5,b+.5)
 show()
 
 -- 
 Jouni K. Seppänen
 http://www.iki.fi/jks
 
 
 --
 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-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users
 
 

-- 
View this message in context: 
http://www.nabble.com/showing-current-value-on-boxplot-tp25115648p25130265.html
Sent from the matplotlib - users mailing list archive at Nabble.com.


--
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-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Problem with hitlist(evt) - Possible solution

2009-08-25 Thread Romi Agar
The solution I came up with without delving into the code is to add the 
following two lines to lines.py:286, so that self._transformed_path gets 
assigned a value if it is None before it is accessed:
if self._transformed_path is None:
self._transform_path()


--
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-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] contour lines not hidden by patches

2009-08-25 Thread Auré Gourrier
Can't figure this out: I create a figure, add some axes, define data to be 
plotted as a contourf + contour on top and then add some patches to hide some 
regions of my plot.
The patches hide the contourf correctly, as expected, but not the contour 
lines...
Could someone telle me whether I'm doing something wrong ?
Below are the code lines.
I'm using python 2.4, matplotlib 0.91.2

Thanks in advance,

Aure


#--
pylab.clf()

fig = pylab.figure(figsize=(7.,3.8),dpi=100,facecolor='white')

axes1 = fig.add_axes((.),label='axes1')
axes2 = fig.add_axes((.),label='axes2')
axes3 = fig.add_axes((.),label='axes3')

#define contour data
contourstep = 0.05
contourx  = np.arange(0.01,2.5+contourstep,contourstep)
contoury = np.arange(0.01,4.+contourstep,contourstep)
contourxy1 = np.ones((len(contoury),len(contourx)))
contourxy2 = np.ones((len(contoury),len(contourx)))
x = np.arange(0.,6.,0.01)
for j in range(contourxy1.shape[0]):
for k in range(contourxy1.shape[1]):
newval1=...
newval2=...
contourxy1[j,k] = newval1
contourxy2[j,k] = newval2

#add contour
levels = np.arange(0.0,0.85,0.05)
cf1 = 
axes1.contourf(-contourx,contoury,contourxy2,levels,cmap=bone_r,extend = 'max') 
  #cmap=mpl.cm.gray_r)
cf2 = axes2.contourf(contourx,contoury,contourxy1,levels,cmap=bone_r,extend 
= 'max')   #cmap=mpl.cm.gray_r)
levels2 = np.arange(0.,.45,0.05)
axes1.contour(-contourx,contoury,contourxy2,levels2,colors='gray')
axes2.contour(contourx,contoury,contourxy1,levels2,colors='gray')

#add patches
axes1.add_patch(mpl.patches.Polygon([(-1.,1),(-2.,1.),(-2.,2.)],
edgecolor='k',
facecolor='w',
))
axes1.add_patch(mpl.patches.Polygon([(-1.,1.),(0.,0.),(0.,1.)],
edgecolor='k',
facecolor='w',
))
axes2.add_patch(mpl.patches.Polygon([(0.,1.),(2.,1.),(2.,2.),(0.,2.)],
edgecolor='k',
facecolor='w',
))

pylab.savefig(outputfilename)
#--



  --
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-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] APLpy 0.9.4 Release

2009-08-25 Thread Astronomical Python
We are pleased to announce the release of APLpy 0.9.4, which includes
bug fixes, improvements, and new features.

APLpy is a python module that makes it easy to interactively produce
publication-quality plots of astronomical images in FITS format. More
details are available at http://aplpy.sourceforge.net/

The main change with this release is that APLpy now requires
matplotlib 0.99. More information on the changes in this version is
available in the release notes available from the APLpy homepage.

From the front page you can sign up to the mailing list and/or the
Twitter feed to be kept up-to-date on future releases.

Cheers,

Eli Bressert and Thomas Robitaille

--
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-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] contour lines not hidden by patches

2009-08-25 Thread Jouni K . Seppänen
Auré Gourrier aurelien.gourr...@yahoo.fr writes:

 The patches hide the contourf correctly, as expected, but not the
 contour lines...

Sounds like a zorder problem:

http://matplotlib.sourceforge.net/examples/pylab_examples/zorder_demo.html

 Below are the code lines.

Since several details were edited out, the code sample is not runnable,
so I couldn't try it out myself. I think it's probably the zorder,
though.

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
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-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Pareto diagram - align cumulative percentage marker in the middle of the bars

2009-08-25 Thread Werner F. Bruhin




I trying to create a Pareto diagram and would like that the percentage
marker is center aligned on the bars, i.e. the blue point should be
center aligned on the bar instead of to be aligned on the left edge in
the following image. 



The other problem I have is that the xtick_labels are cut off at the
bottom when the frame is resized below a certain size. How can I
prevent this?

Thanks for any tips on these problems.
Werner


--
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-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Memory leak somewhere?

2009-08-25 Thread pixolex pixolex
You made my day!

Long life to The close()

All my ram and swap file was sucked every time a run my script to generate
260 png images...almost killing my ubuntu!

On Tue, May 26, 2009 at 2:23 PM, John Hunter jdh2...@gmail.com wrote:

 On Tue, May 26, 2009 at 7:39 AM, Michael Droettboom md...@stsci.edu
 wrote:
  Does it help if you add a call to plt.clf() to the bottom of the loop?
 
  The pyplot interface keeps a reference around to every figure created
  until they are destroyed so that it can be obtained again by number
  (this is functionality inspired by matlab).  Alternatively, you can use
  the object-oriented interface to create the figure, which does not have
  this behavior, e.g., replace
 
fig = plt.figure()
 
  with
 
from matplotlib import figure
fig = figure.Figure()
 
  If all this doesn't help, let me know and I'll look further.
 
  Cheers,
  Mike
 
  iCy-fLaME wrote:
  I was trying to use matplotlib to plot a series of 2D images, but
  python was using up a large amount of RAM very quickly. I don't know
  matplotlib that well, so the chance are I am missing something, would
  appreciate it if anyone can point me to the right direction.
 
  I am using:
  Python 2.4.3 (#1, Jan 21 2009, 01:11:33)
  [GCC 4.1.2 20071124 (Red Hat 4.1.2-42)] on linux2
 
  Example code to run in interpreter mode:
 
  
  from numpy import zeros
 
  x = 1651
  y = 452
  page = zeros((x, y)).astype('float')
 
  import matplotlib
  matplotlib.use('Agg')
  import matplotlib.pyplot as plt
 
  for i in range(1000):
fig = plt.figure()
ax = fig.add_subplot(111)
cax = ax.imshow(page, cmap=plt.cm.spectral_r, extent=(-44, 176,
 -30,
  30), interpolation = 'bicubic', vmin = -0.003, vmax = 0.003)
title = Time = %(i)0.3es) % {'i':i}
ax.set_title(title,fontsize=14)
 
fig.colorbar(cax, ticks=[-2e-3, -1e-3, 0, 1e-3, 2e-3],
  orientation='horizontal')
 
fig.savefig('_tmp.' + str(i) + .png, dpi=300)


 This code creates 1000 different figures -- either reuse the same
 figure and clear it as Michael suggests

  fig = plt.figure(1)  # by putting 1 here you reuse the same fig
  fig.clf()  # and clear it

 or close the figure in the loop

  fig = plt.figure()
  # draw and save here
  plt.close(fig)

 JDH


 --
 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 asthey present alongside digital heavyweights like Barbarian
 Group, R/GA,  Big Spaceship. http://www.creativitycat.com
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
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-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Custom ticklabels on colorbar

2009-08-25 Thread Jae-Joon Lee
Please, take your time and post a standalone code that reproduces
your problem so that others can actually test. Also, please describe
what results you have and why they are wrong.

On Tue, Aug 25, 2009 at 4:08 AM, Daniel
Platzmail.to.daniel.pl...@googlemail.com wrote:
 fig1.colorbar(pc1,ax=ax1,orientation='horizontal',pad=0.025,ticks=temp,format=r$%2.1f\%%$)
     cb1.ax.set_xticklabels(temp,fontsize=10,family='serif')

The set_xticklabels command actually overrides the format setting you
specified in the colorbar call, which might be the reason that the
script does not work as you intended. But, it is hard to tell without
the runnable code.

-JJ

--
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-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Pareto diagram - align cumulative percentage marker in the middle of the bars

2009-08-25 Thread Jouni K . Seppänen
Werner F. Bruhin werner.bru...@free.fr writes:

 I trying to create a Pareto diagram and would like that the percentage
 marker is center aligned on the bars,

Perhaps the easiest solution is to use bar(...,align='center').

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
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-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Pareto diagram - align cumulative percentage marker in the middle of the bars

2009-08-25 Thread Werner F. Bruhin
Jouni K. Seppänen wrote:
 Werner F. Bruhin werner.bru...@free.fr writes:

   
 I trying to create a Pareto diagram and would like that the percentage
 marker is center aligned on the bars,
 

 Perhaps the easiest solution is to use bar(...,align='center').
   
Thanks, that does the trick for me, after getting rid of some hack for 
the bar labels.

Werner





--
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-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Pareto diagram - align cumulative percentage marker in the middle of the bars

2009-08-25 Thread Christopher Barker
Werner F. Bruhin wrote:
 The other problem I have is that the xtick_labels are cut off at the 
 bottom when the frame is resized below a certain size.  How can I 
 prevent this?

I don't think MPL yet has a system for making things fit, so you need to 
change the size/position of your axes object:

axes.set_position(pos, which='both')


 Set the axes position with:

 pos = [left, bottom, width, height]


these are in figure units which are relative to figure size, from 0 to 
1. Unfortunately, what this means is that the amount of space for the 
axis labels varies with the size of the figure, as you've discovered.


The default for a single axes in a figure is:

(0.125,  0.1,  0.9,  0.9)

so you might try something like:

axes.set_position((0.125,  0.15,  0.9,  0.85) )

what is best depends on what size you want your figure to look good at.

-Chris


-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/ORR(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

chris.bar...@noaa.gov

--
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-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] possible bug with linestyle='steps'

2009-08-25 Thread Paul Ray
Hi,

I just installed matplotlib 0.99.0 and I see that this problem is  
still there.
The command plot(a,ls='steps') is equivalent to plot(a,ls='steps-pre')  
and both cause the first value of the array to NOT be plotted.  This  
is REALLY not what should happen when one plots an array with several  
values.  It is fine if there is a custom option to make that behavior  
(like 'steps-pre'), but the default for ls='steps' or step(x,y) must  
be to have the first flat level at the level of the first entry (what  
the 'steps-post' does).

The docstring now correctly describes the behavior, so that is good,  
but please please make the default steps be steps-post.

Thanks,

-- Paul

On Jul 19, 2009, at 9:35 AM, John Hunter wrote:

 On Fri, Jul 17, 2009 at 5:15 PM, Paul Raypaul@nrl.navy.mil  
 wrote:


 Ryan Krauss-2 wrote:

 RTFM:

 plot(t,y, drawstyle='steps-post')



 Actually, 'steps-pre' (which is the default) and 'steps-post' seem  
 to have
 swapped definitions.
 Here is what the docs say:
*where*: [ 'pre' | 'post' | 'mid'  ]
  If 'pre', the interval from x[i] to x[i+1] has level y[i]
  If 'post', that interval has level y[i+1]
  If 'mid', the jumps in *y* occur half-way between the
  *x*-values.

 In fact both the default behavior and what you get with steps-pre  
 are what
 SHOULD happen with steps-post.  And steps-post (as you point out)  
 does what
 should be the default behavior and that of steps-pre.

 I have filed a bug report on this, since it is very important that  
 this work
 as expected.  As the original poster pointed out, this used to work
 correctly but recently seems to have gotten broken.



 I am looking first at the behavior of plot with the drawstyle property
 set -- let's make sure this is correct before turning to the steps
 command, which just uses plot with the drawstyle set -- here is my
 test code

 import numpy as np
 import matplotlib.pyplot as plt

 fig = plt.figure()
 ax = fig.add_subplot(111)

 a = np.array([1,2,3,4,5])

 styles = 'default' , 'steps' , 'steps-pre' , 'steps-mid' , 'steps- 
 post'
 styles = 'steps' , 'steps-pre'
 for ls in styles:
ax.plot(a, ls=ls, label=ls, lw=2)

 ax.legend(loc='upper left')

 plt.show()


 pre causes the step to rise on the x[i], post causes it to rise on
 x[i+1] and mid in the middle.  This seems like the correct behavior.
 So it does look like the docstring for  'step' is incorrect, and I've
 changed it to read


*where*: [ 'pre' | 'post' | 'mid'  ]
  If 'pre', the interval from x[i] to x[i+1] has level y[i+1]

  If 'post', that interval has level y[i]

  If 'mid', the jumps in *y* occur half-way between the


 JDH


--
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-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Issue with Matplotlib on Win32 and ImportError: DLL load failed

2009-08-25 Thread Patrick Rynhart
On Fri, Aug 7, 2009 at 7:27 PM, John Hunterjdh2...@gmail.com wrote:
 On Thu, Aug 6, 2009 at 8:48 PM, Patrick Rynhartprynh...@gmail.com wrote:
 Dear all,

 We are using Python 2.5, matplotlib and NumPy on Windows to assist
 with the teaching for an undergraduate paper.  On a small number of
 installations, an error attempting to load some required DLL's is
 being reported (on approx 3 machines out of approximately 60).  There
 doesn't appear to be any pattern with this - we can seen it on one
 install of Windows Server 2008 and also on various versions of Windows
 XP (Professional and Home).

 Symptoms are, after a from pylab import *, the following traceback:

 Traceback (most recent call last):
  File C:\Documents and
 Settings\Jo\workspace\test\src\root\nested\__init__.py, line 2, in
 module
from pylab import *
  File C:\Python25\Lib\site-packages\pylab.py, line 1, in module
from matplotlib.pylab import *
  File C:\Python25\Lib\site-packages\matplotlib\pylab.py, line 206,
 in module
from matplotlib import mpl  # pulls in most modules
  File C:\Python25\Lib\site-packages\matplotlib\mpl.py, line 1, in module
from matplotlib import artist
  File C:\Python25\Lib\site-packages\matplotlib\artist.py, line 4, in 
 module
from transforms import Bbox, IdentityTransform, TransformedBbox,
 TransformedPath
  File C:\Python25\Lib\site-packages\matplotlib\transforms.py, line
 34, in module
from matplotlib._path import affine_transform
 ImportError: DLL load failed: The specified module could not be found.

 We have seen this problem several times  before, and have labored hard
 to banish it, but it always has a way of coming back to haunt us.  I
 am aware of a bug in python2.6 which causes mingw to build broken
 win32 binaries, but am not aware of such  a problem w/ python2.5,
 which you appear to be using.  We often use a program called
 dependency walker to track these problems down:

  http://www.dependencywalker.com/

 Open the problematic file (it should be
 C:\Python25\Lib\site-packages\matplotlib\_path.pyd) and report any
 errors you find here; it should tell you which DLLs are missing.
 Search the good and the bad boxes for these DLL filenames and see if
 it is a difference in the boxes, eg do the good boxes have the DLL and
 the bad boxes not, and if so maybe you can figure out why (different
 version in the OS patch level?).  I am really interested to know the
 difference in the boxes because it may give us the critical clue as to
 why some users report this problem and others do not see it.

 Also, on one of the bad boxes, could you try the new 0.99 release and
 let me know if you have the same issue?

 I build the python2.5 installers with mingw; Christoph builds the
 python2.6 installers with Visual Studio precisely because mingw is
 broken on python2.6.  If we can't banish this bug on 2.5 w/ mingw, I
 may have to lean on his generosity and ask him to make a python2.5
 installer with Visual Studio as well.

 JDH

 PS: rereading your email, I see you are using 0.98.3.  The first time
 I read it, when I wrote the response above, I thought you were using
 0.98.5.3 -- the .3 at the end tricked me.  The latter is fairly
 recent, and came out 10 months after 0.98.3, and we did several things
 to fix exactly this dll problem in interim.  At a minimum, you need to
 be testing and installing 0.98.5.3.  This is a very stable, bug fix
 release, suitable for use in the classroom.  I can't guarantee you
 won't hit the same problem, but at least you will be using a version
 that *shouldn't* have it, though I am still interested in the results
 of the dependency walker tests above, because I have wasted so much
 time trying to fix these win32 installers.


Dear John,

Many thanks for your detailed post with regard to how to troubleshoot
this issue.  The use of dependency walker allowed me to determine that
affected systems were missing the Visual C/C++ shared runtime
libraries - in particular, MSVCP71.DLL (the version of the runtime
shipped with Microsoft Visual C++ .NET 2003) was missing on these
systems.

According to http://support.microsoft.com/default.aspx/kb/326922,
installing the .NET 1.1 framework should - as a side-effect - also
install this DLL.  However, on Windows Server 2008 (the only box that
I have direct access to in a faulted state) this DLL didn't seem to
install when I installed the .NET 1.1 framework.

(Aside: This could be because Explorer in Vista/2K8 appears to hide
system files exceptionally well.  Even after playing with the Windows
Desktop Search syntax I couldn't get a match.  Dropping to a cmd
prompt and listing %systemroot%\system32 also didn't provide a match
for the DLL.)

On one of the student Windows XP machines, I copied the above DLL from
a working XP SP3 install to C:\Python25\Lib\site-packages\matplotlib
and confirmed that matplotlib then works correctly.  Attempting the
same trick on Server 2K8 didn't work, but this is probably to be
expected (given that it's 

Re: [Matplotlib-users] Issue with Matplotlib on Win32 and ImportError: DLL load failed

2009-08-25 Thread Patrick Rynhart
Hi again,

Just to update you, copying across the Visual C/C++ runtime library
(MSVCP71.DLL) from a Windows XP SP3 install to
C:\Python25\Lib\site-packages\matplotlib on Windows Server 2008 does
in fact appear to work correctly with matplotlib after all.

Regards,

Patrick

--
Dr Patrick Rynhart
Linux Systems Administrator / Team Leader
IT Support Group
School of Engineering and Advanced Technology
AgHort A Room 3.61
Massey University (Turitea Campus)
NEW ZEALAND
Phone +64 6 356 9099 extn 2444

--
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-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Issue with Matplotlib on Win32 and ImportError: DLL load failed

2009-08-25 Thread John Hunter
On Tue, Aug 25, 2009 at 4:59 PM, Patrick Rynhartprynh...@gmail.com wrote:

 Thanks again for your help.  Do you think that testing for the version
 of the Visual C redistributable is required during an install of
 matplotlib (and/or possibly at runtime).

This shouldn't be an issue with recent binaries of mpl, eg 0.99 and
later, so hopefully we won't have to worry about this install check.
I think we've fixed the MSVCP71.DLL problem, but if you experience
otherwise let us know.

JDH

--
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-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users