Re: [Matplotlib-users] ginput(0) termination error

2010-06-07 Thread Thøger Emil Juul Thorsen
Bump - no one knows a solution/workaround to this?


 Hello list; 
 
 I'm new to python/matplotlib, migrating from IDL. I need to do some
 interactive point selection with mouse, and the pyplot.ginput() routine
 seemed to be just the right thing here. I do however need to be able to
 make a not previously specified number of clicks, so ginput(n=0) is a
 requirement. 
 
 However, when I press enter on my laptop (with no middle mouse button),
 I get the error message:
 
 TypeError: stop_event_loop() takes exactly 1 argument (2 given)
 
 I've tried two different pieces of example code from the matplotlib SF
 page.
 I'm using Matplotlib 0.99.1 on Ubuntu 10.04.
 Is there any solution or workaround? If I cannot have this
 functionality, it is, unfortunately, kind of a deal breaker for at least
 some of my work, and I'd like to keep it purely Python.
 
 Best regards; 
 
 Emil
 
 
 --
 ThinkGeek and WIRED's GeekDad team up for the Ultimate 
 GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
 lucky parental unit.  See the prize list and enter to win: 
 http://p.sf.net/sfu/thinkgeek-promo
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users



--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] ginput(0) termination error

2010-06-07 Thread Marius 't Hart
Can't you do ginput(n=1) in a while loop? Ginput needs to end at some 
point, right? Initiating a never ending loop seems like the wrong 
solution for any real-life problem.

On 06/07/2010 01:15 PM, Thøger Emil Juul Thorsen wrote:
 Bump - no one knows a solution/workaround to this?



 Hello list;

 I'm new to python/matplotlib, migrating from IDL. I need to do some
 interactive point selection with mouse, and the pyplot.ginput() routine
 seemed to be just the right thing here. I do however need to be able to
 make a not previously specified number of clicks, so ginput(n=0) is a
 requirement.

 However, when I press enter on my laptop (with no middle mouse button),
 I get the error message:

 TypeError: stop_event_loop() takes exactly 1 argument (2 given)

 I've tried two different pieces of example code from the matplotlib SF
 page.
 I'm using Matplotlib 0.99.1 on Ubuntu 10.04.
 Is there any solution or workaround? If I cannot have this
 functionality, it is, unfortunately, kind of a deal breaker for at least
 some of my work, and I'd like to keep it purely Python.

 Best regards;

 Emil


 --
 ThinkGeek and WIRED's GeekDad team up for the Ultimate
 GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
 lucky parental unit.  See the prize list and enter to win:
 http://p.sf.net/sfu/thinkgeek-promo
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users
  


 --
 ThinkGeek and WIRED's GeekDad team up for the Ultimate
 GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
 lucky parental unit.  See the prize list and enter to win:
 http://p.sf.net/sfu/thinkgeek-promo
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users



--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] ginput(0) termination error

2010-06-07 Thread Jae-Joon Lee
I think this is a known bug (unfortunately, the bug fix does not seem
to be reflected in the maintenance version), but without a full
traceback, I'm not 100% sure.

You may use the svn version which have fixed this bug, or you may try
the workaround described in the link below (check the
clabel_monkeypatching.py).

http://sourceforge.net/tracker/index.php?func=detailaid=2922835group_id=80706atid=560720

-JJ



2010/6/4 Thøger Emil Juul Thorsen thoe...@fys.ku.dk:
 Hello list;

 I'm new to python/matplotlib, migrating from IDL. I need to do some
 interactive point selection with mouse, and the pyplot.ginput() routine
 seemed to be just the right thing here. I do however need to be able to
 make a not previously specified number of clicks, so ginput(n=0) is a
 requirement.

 However, when I press enter on my laptop (with no middle mouse button),
 I get the error message:

 TypeError: stop_event_loop() takes exactly 1 argument (2 given)

 I've tried two different pieces of example code from the matplotlib SF
 page.
 I'm using Matplotlib 0.99.1 on Ubuntu 10.04.
 Is there any solution or workaround? If I cannot have this
 functionality, it is, unfortunately, kind of a deal breaker for at least
 some of my work, and I'd like to keep it purely Python.

 Best regards;

 Emil


 --
 ThinkGeek and WIRED's GeekDad team up for the Ultimate
 GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
 lucky parental unit.  See the prize list and enter to win:
 http://p.sf.net/sfu/thinkgeek-promo
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Help with imshow on Mac OS X 10.6 Snow Leopoard

2010-06-07 Thread Todd V Rovito
Greetings,
I just installed Python 2.6 (python.org), Numpy 1.4.1, and Matplotlib
0.99.1.2 all on Mac OS X 10.6 in an attempt to learn about scientific
programming in python.  Go easy on me since I am a begginer.  The Python and
Numpy seem to be working correctly.  I can get matplotlib to make plots but
I can't get it to show images.  I tried the stinkbug example in
the Matplotlib users guide documentation with no success.  Errors are _NOT_
generated but neither are any results on the screen.  The imread command
produces a float32 matrix that contains all 1. values so I tried creating my
own uint8 matrix with a diagnoal line.  My code is below.  Thanks for any
help you can provide.



# -*- coding: utf-8 -*-
from numpy import *
import matplotlib.pyplot as plt
import matplotlib.image as mpimg

print Numpy version:  + __version__
a = array([10,20,30,40])
print result of a
print a

b = arange(4)
print result of b
print b

c = linspace(-pi, pi, 30)
print result of c
print c

# this plot code works
print plot c
plt.plot(c)
plt.ylabel(-pi to + pi)
plt.xlabel(value of c)
plt.show()

# this image processing code does not work
print doing image processing stuff
# img=mpimg.imread(/Users/rovitotv/Desktop/stinkbug.png) # this does not
work
img = zeros((10, 10), dtype=uint8)
for i in range(10):
img[i,i] = 255;

plt.imshow(img)
print data type of img:
print img.dtype
print size of img: + str(img.size)
print img
--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Help with imshow on Mac OS X 10.6 Snow Leopoard

2010-06-07 Thread Benjamin Root
Todd,

I think you are missing a plt.show() at the end of your code.  matplotlib,
by default on most systems, does not show a plot until you tell it to using
plt.show() command.

See if that works,
Ben Root

On Mon, Jun 7, 2010 at 7:57 AM, Todd V Rovito rovit...@gmail.com wrote:

 Greetings,
 I just installed Python 2.6 (python.org), Numpy 1.4.1, and Matplotlib
 0.99.1.2 all on Mac OS X 10.6 in an attempt to learn about scientific
 programming in python.  Go easy on me since I am a begginer.  The Python and
 Numpy seem to be working correctly.  I can get matplotlib to make plots but
 I can't get it to show images.  I tried the stinkbug example in
 the Matplotlib users guide documentation with no success.  Errors are _NOT_
 generated but neither are any results on the screen.  The imread command
 produces a float32 matrix that contains all 1. values so I tried creating my
 own uint8 matrix with a diagnoal line.  My code is below.  Thanks for any
 help you can provide.



 # -*- coding: utf-8 -*-
 from numpy import *
 import matplotlib.pyplot as plt
 import matplotlib.image as mpimg

 print Numpy version:  + __version__
 a = array([10,20,30,40])
 print result of a
 print a

 b = arange(4)
 print result of b
 print b

 c = linspace(-pi, pi, 30)
 print result of c
 print c

 # this plot code works
 print plot c
 plt.plot(c)
 plt.ylabel(-pi to + pi)
 plt.xlabel(value of c)
 plt.show()

 # this image processing code does not work
 print doing image processing stuff
 # img=mpimg.imread(/Users/rovitotv/Desktop/stinkbug.png) # this does not
 work
 img = zeros((10, 10), dtype=uint8)
 for i in range(10):
 img[i,i] = 255;

 plt.imshow(img)
 print data type of img:
 print img.dtype
 print size of img: + str(img.size)
 print img




 --
 ThinkGeek and WIRED's GeekDad team up for the Ultimate
 GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
 lucky parental unit.  See the prize list and enter to win:
 http://p.sf.net/sfu/thinkgeek-promo
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Animated Line2D

2010-06-07 Thread Nie, Jinsuo
I modified the path_editor.py example in order to make a line editor, as
attached.  However, the line is not animated even the line has been
correctly updated.  It seems canvas.blit is not functioning correctly in
motion_notify_callback.   Canvas.blit works in draw_callback because the
initial line can be plotted.  

 

I read the Curse implement which uses lines.  This implementation uses
visible but not animated property to achieve the animation.  Any reason
for that?

 

I appreciated any suggestions to fix this problem.  

 

 Jinsuo Nie



 



line_editor.py
Description: line_editor.py
--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] sizing shapes on a plot to match axis units, not graphic points

2010-06-07 Thread Ian Stokes-Rees
I'm generating a plot of NxN squares, where the size of the square
corresponds to the correlation between the (i,j) point.  Every (i,i)
point equals 1.0.  I'm using scatter to do this, but the sizing
appears to be in points from the graphic, rather than units of the
two axes.  Is there some way to account for this, or is there some
better way to generate this image?

# result = n x n matrix of correlations between points (i,j)
a = arange(n).repeat(n).reshape(n,n)
b = a.transpose()
scatter(a.flatten(), b.flatten(), s=result, marker='s')

You can see an example here, where N=300: (note, this is a 2.5  MB image):

http://abitibi.sbgrid.org/se/data/shared/biodb/scop-class/a/39/1/5/.meta/tmscore2.png

Thanks,

Ian

-- 
Ian Stokes-Rees, PhD   W: http://hkl.hms.harvard.edu
ijsto...@hkl.hms.harvard.edu   T: +1 617 432-5608 x75
NEBioGrid, Harvard Medical School  C: +1 617 331-5993



--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] sizing shapes on a plot to match axis units, not graphic points

2010-06-07 Thread Michael Droettboom
Since this data is essentially a 2 dimensional image, you may want to 
experiment with imshow.

Mike

On 06/07/2010 11:16 AM, Ian Stokes-Rees wrote:
 I'm generating a plot of NxN squares, where the size of the square
 corresponds to the correlation between the (i,j) point.  Every (i,i)
 point equals 1.0.  I'm using scatter to do this, but the sizing
 appears to be in points from the graphic, rather than units of the
 two axes.  Is there some way to account for this, or is there some
 better way to generate this image?

 # result = n x n matrix of correlations between points (i,j)
 a = arange(n).repeat(n).reshape(n,n)
 b = a.transpose()
 scatter(a.flatten(), b.flatten(), s=result, marker='s')

 You can see an example here, where N=300: (note, this is a 2.5  MB image):

 http://abitibi.sbgrid.org/se/data/shared/biodb/scop-class/a/39/1/5/.meta/tmscore2.png

 Thanks,

 Ian




-- 
Michael Droettboom
Science Software Branch
Space Telescope Science Institute
Baltimore, Maryland, USA


--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] sizing shapes on a plot to match axis units, not graphic points

2010-06-07 Thread Tony S Yu
On Jun 7, 2010, at 11:16 AM, Ian Stokes-Rees wrote:I'm generating a plot of NxN squares, where the size of the squarecorresponds to the correlation between the (i,j) point. Every (i,i)point equals 1.0. I'm using "scatter" to do this, but the sizingappears to be in "points" from the graphic, rather than "units" of thetwo axes. Is there some way to account for this, or is there somebetter way to generate this image?# result = n x n matrix of correlations between points (i,j)a = arange(n).repeat(n).reshape(n,n)b = a.transpose()scatter(a.flatten(), b.flatten(), s=result, marker='s')You can see an example here, where N=300: (note, this is a 2.5 MB image):http://abitibi.sbgrid.org/se/data/shared/biodb/scop-class/a/39/1/5/.meta/tmscore2.pngThanks,IanWhat you're doing sounds very similar to a Hinton diagrom (or at least the resulting image looks similar). There's an example of plotting such a diagram in the scipy cookbook:http://www.scipy.org/Cookbook/Matplotlib/HintonDiagramsThe implementation is pretty slow because it loops through the data and draws each square one by one. I wrote a faster alternative a while back (see attached). It uses a custom PolyCollection, which uses data units for the areas instead of figure units. Also, I just noticed there's another implementation of Hinton diagrams in the matplotlib examples folder (examples/api/hinton_demo.py). For some reason, this example doesn't appear on the website, otherwise I'd link to it.I believe the difference between your plot and a hinton diagram is that you have a different metric for calculating the size of the squares.-Tonyimport numpy as np
import matplotlib.pyplot as plt
import matplotlib.collections as collections
import matplotlib.transforms as transforms


class SquareCollection(collections.RegularPolyCollection):
Return a collection of squares.

def __init__(self, **kwargs):
super(SquareCollection, self).__init__(4, rotation=np.pi/4., **kwargs)

def get_transform(self):
Return transform scaling circle areas to data space.
ax = self.axes
pts2pixels = 72.0 / ax.figure.dpi
scale_x = pts2pixels * ax.bbox.width / ax.viewLim.width
scale_y = pts2pixels * ax.bbox.height / ax.viewLim.height
return transforms.Affine2D().scale(scale_x, scale_y)

def hinton(inarray, max_weight=None):
Draw Hinton diagram for visualizing a weight matrix.
ax = plt.gca()
ax.set_axis_bgcolor('gray')
# make sure we're working with a numpy array, not a numpy matrix
inarray = np.asarray(inarray)
height, width = inarray.shape
if max_weight is None:
max_weight = 2**np.ceil(np.log(np.max(np.abs(inarray)))/np.log(2))
weights = np.clip(inarray/max_weight, -1, 1)
rows, cols = np.mgrid[:height, :width]

pos = np.where(weights  0)
neg = np.where(weights  0)
for idx, color in zip([pos, neg], ['white', 'black']):
if len(idx[0])  0:
xy = zip(cols[idx], rows[idx])
circle_areas = np.pi / 2 * np.abs(weights[idx])
squares = SquareCollection(sizes=circle_areas, 
   offsets=xy, transOffset=ax.transData,
   facecolor=color, edgecolor=color)
ax.add_collection(squares, autolim=True)
plt.axis('scaled')
ax.set_xlim(-0.5, width-0.5)
ax.set_ylim(height-0.5, -0.5)
ax.set_xlabel('column')
ax.set_ylabel('row')
ax.xaxis.set_ticks_position('top')
ax.xaxis.set_label_position('top')


if __name__ == '__main__':
u = lambda x: 3/4. * x**2 - 0.5 * x
A = np.array([[0, 0.5, 1], [-0.5, 0, 0.5], [-1, -0.5, 0]])
print A
hinton(A)
plt.show()
--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Animated Line2D

2010-06-07 Thread John Hunter
On Mon, Jun 7, 2010 at 10:14 AM, Nie, Jinsuo j...@bnl.gov wrote:
 I modified the path_editor.py example in order to make a line editor, as
 attached.  However, the line is not animated even the line has been
 correctly updated.  It seems canvas.blit is not functioning correctly in
 motion_notify_callback.   Canvas.blit works in draw_callback because the
 initial line can be plotted.

Unfortunately, I cannot understand your problem.  I have tried running
your attached example and it seems to run fine on my system (I can
drag the vertices and the line drawing is updated).  Can you describe
the problem you are seeing?  Could this be a version problem -- what
version of mpl are you running?

  jo...@udesktop191:Downloads python -c 'import matplotlib; print
matplotlib.__version__'
  1.0.svn


 I read the Curse implement which uses lines.  This implementation uses
 visible but not animated property to achieve the animation.  Any reason for
 that?

Do you mean matplotlib.widgets.Cursor?  It does use the animated
property -- at least in the svn version.  See the line in the __init__
function:

if useblit:
lineprops['animated'] = True

JDH

--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Animated Line2D

2010-06-07 Thread Nie, Jinsuo
John,

Thank you very much for a prompt reply.

I am using Ipython with QT4 backend for the examples.  I can have animated plot 
(dragable vertices) for the path_editor.py, but not for the line_editor.py.  My 
python installation is pythonxy on windows 7. Could you please tell me your 
installation? 

Yes, I do mean the matplotlib.widgets.Cursor, and I have version of 0.99.1. My 
version does not have the two lines as you mentioned. 

--
Jinsuo


-Original Message-
From: John Hunter [mailto:jdh2...@gmail.com] 
Sent: Monday, June 07, 2010 12:19 PM
To: Nie, Jinsuo
Cc: matplotlib-users@lists.sourceforge.net
Subject: Re: [Matplotlib-users] Animated Line2D

On Mon, Jun 7, 2010 at 10:14 AM, Nie, Jinsuo j...@bnl.gov wrote:
 I modified the path_editor.py example in order to make a line editor, as
 attached.  However, the line is not animated even the line has been
 correctly updated.  It seems canvas.blit is not functioning correctly in
 motion_notify_callback.   Canvas.blit works in draw_callback because the
 initial line can be plotted.

Unfortunately, I cannot understand your problem.  I have tried running
your attached example and it seems to run fine on my system (I can
drag the vertices and the line drawing is updated).  Can you describe
the problem you are seeing?  Could this be a version problem -- what
version of mpl are you running?

  jo...@udesktop191:Downloads python -c 'import matplotlib; print
matplotlib.__version__'
  1.0.svn


 I read the Curse implement which uses lines.  This implementation uses
 visible but not animated property to achieve the animation.  Any reason for
 that?

Do you mean matplotlib.widgets.Cursor?  It does use the animated
property -- at least in the svn version.  See the line in the __init__
function:

if useblit:
lineprops['animated'] = True

JDH

--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Index Out of Range Error after Installation on RHEL5

2010-06-07 Thread Dharhas Pothina
Hi,

I have Python 2.6 installed on RHEL5 (and Numpy 1.4.1) and am trying to install 
matplotlib. Installation occurs without any error messages although I do get a 
bunch of warnings at the end. 

/usr/bin/ld: skipping incompatible /usr/lib/libtk8.4.so when searching for 
-ltk8.4
/usr/bin/ld: skipping incompatible /usr/lib/libtcl8.4.so when searching for 
-ltcl8.4
/usr/bin/ld: skipping incompatible /usr/lib/libfreetype.so when searching for 
-lfreetype
/usr/bin/ld: skipping incompatible /usr/lib/libz.so when searching for -lz
/usr/bin/ld: skipping incompatible /usr/lib/libz.a when searching for -lz
/usr/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
/usr/bin/ld: skipping incompatible /usr/lib/libm.a when searching for -lm
/usr/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
/usr/bin/ld: skipping incompatible /usr/lib/libm.a when searching for -lm
/usr/bin/ld: skipping incompatible /usr/lib/libpthread.so when searching for 
-lpthread
/usr/bin/ld: skipping incompatible /usr/lib/libpthread.a when searching for 
-lpthread
/usr/bin/ld: skipping incompatible /usr/lib/libc.so when searching for -lc
/usr/bin/ld: skipping incompatible /usr/lib/libc.a when searching for -lc

When I try using matplotlib I get the following error:

Python 2.6.5 (r265:79063, May 18 2010, 11:20:57) 
[GCC 4.1.2 20080704 (Red Hat 4.1.2-48)] on linux2
Type help, copyright, credits or license for more information.
 import matplotlib.pyplot as plt
 plt.plot([1,0],[2,3])
Traceback (most recent call last):
  File stdin, line 1, in module
  File 
/home/swdata/.virtualenvs/web/lib/python2.6/site-packages/matplotlib/pyplot.py,
 line 2141, in plot
ret = ax.plot(*args, **kwargs)
  File 
/home/swdata/.virtualenvs/web/lib/python2.6/site-packages/matplotlib/axes.py, 
line 3437, in plot
self.autoscale_view(scalex=scalex, scaley=scaley)
  File 
/home/swdata/.virtualenvs/web/lib/python2.6/site-packages/matplotlib/axes.py, 
line 1624, in autoscale_view
XL = self.xaxis.get_major_locator().view_limits(x0, x1)
  File 
/home/swdata/.virtualenvs/web/lib/python2.6/site-packages/matplotlib/ticker.py,
 line 1014, in view_limits
return np.take(self.bin_boundaries(dmin, dmax), [0,-1])
  File 
/home/swdata/.virtualenvs/web/lib/python2.6/site-packages/numpy/core/fromnumeric.py,
 line 103, in take
return take(indices, axis, out, mode)
IndexError: index out of range for array


Any help would be appreciated. I've tried several versions of matplotlib. I 
also was able to get it installed on a different RHEL5 machine a while back and 
am not sure what is different about this machine.

thanks

- dharhas

--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] masked array problem

2010-06-07 Thread James Evans
I am having a problem when using masked arrays.  The attached scripts are
identical except for the data.  One will actually produce a plot, whereas
the other will not.  I cannot figure out what I am doing wrong, such that
the second script fails.  Am I doing something wrong with this, or is this
an actual bug?

 

Thanks,

--James Evans



masked_array-fail.py
Description: Binary data


masked_array-good.py
Description: Binary data
--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] masked array problem

2010-06-07 Thread Eric Firing
On 06/07/2010 10:41 AM, James Evans wrote:
 I am having a problem when using masked arrays.  The attached scripts
 are identical except for the data. One will actually produce a plot,
 whereas the other will not. I cannot figure out what I am doing wrong,
 such that the second script fails. Am I doing something wrong with this,
 or is this an actual bug?

Maybe a bug that was fixed in mpl, or in a newer version of numpy than 
you are using.  Using both mpl and numpy from svn, both scripts work for me.

Eric


 Thanks,

 --James Evans


--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Index Out of Range Error after Installation on RHEL5

2010-06-07 Thread Benjamin Root
Dharhas,

Is it possible to find out which version of python was installed for your
other RHEL5 machine?  I don't know if that makes a difference or not, but
RHEL5 by default uses Python 2.4.

Ben Root


On Mon, Jun 7, 2010 at 1:48 PM, Dharhas Pothina 
dharhas.poth...@twdb.state.tx.us wrote:

 Hi,

 I have Python 2.6 installed on RHEL5 (and Numpy 1.4.1) and am trying to
 install matplotlib. Installation occurs without any error messages although
 I do get a bunch of warnings at the end.

 /usr/bin/ld: skipping incompatible /usr/lib/libtk8.4.so when searching for
 -ltk8.4
 /usr/bin/ld: skipping incompatible /usr/lib/libtcl8.4.so when searching
 for -ltcl8.4
 /usr/bin/ld: skipping incompatible /usr/lib/libfreetype.so when searching
 for -lfreetype
 /usr/bin/ld: skipping incompatible /usr/lib/libz.so when searching for -lz
 /usr/bin/ld: skipping incompatible /usr/lib/libz.a when searching for -lz
 /usr/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
 /usr/bin/ld: skipping incompatible /usr/lib/libm.a when searching for -lm
 /usr/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
 /usr/bin/ld: skipping incompatible /usr/lib/libm.a when searching for -lm
 /usr/bin/ld: skipping incompatible /usr/lib/libpthread.so when searching
 for -lpthread
 /usr/bin/ld: skipping incompatible /usr/lib/libpthread.a when searching for
 -lpthread
 /usr/bin/ld: skipping incompatible /usr/lib/libc.so when searching for -lc
 /usr/bin/ld: skipping incompatible /usr/lib/libc.a when searching for -lc

 When I try using matplotlib I get the following error:

 Python 2.6.5 (r265:79063, May 18 2010, 11:20:57)
 [GCC 4.1.2 20080704 (Red Hat 4.1.2-48)] on linux2
 Type help, copyright, credits or license for more information.
  import matplotlib.pyplot as plt
  plt.plot([1,0],[2,3])
 Traceback (most recent call last):
  File stdin, line 1, in module
  File
 /home/swdata/.virtualenvs/web/lib/python2.6/site-packages/matplotlib/pyplot.py,
 line 2141, in plot
ret = ax.plot(*args, **kwargs)
  File
 /home/swdata/.virtualenvs/web/lib/python2.6/site-packages/matplotlib/axes.py,
 line 3437, in plot
self.autoscale_view(scalex=scalex, scaley=scaley)
  File
 /home/swdata/.virtualenvs/web/lib/python2.6/site-packages/matplotlib/axes.py,
 line 1624, in autoscale_view
XL = self.xaxis.get_major_locator().view_limits(x0, x1)
  File
 /home/swdata/.virtualenvs/web/lib/python2.6/site-packages/matplotlib/ticker.py,
 line 1014, in view_limits
return np.take(self.bin_boundaries(dmin, dmax), [0,-1])
  File
 /home/swdata/.virtualenvs/web/lib/python2.6/site-packages/numpy/core/fromnumeric.py,
 line 103, in take
return take(indices, axis, out, mode)
 IndexError: index out of range for array


 Any help would be appreciated. I've tried several versions of matplotlib. I
 also was able to get it installed on a different RHEL5 machine a while back
 and am not sure what is different about this machine.

 thanks

 - dharhas


 --
 ThinkGeek and WIRED's GeekDad team up for the Ultimate
 GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
 lucky parental unit.  See the prize list and enter to win:
 http://p.sf.net/sfu/thinkgeek-promo
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Index Out of Range Error after Installation on RHEL5

2010-06-07 Thread Dharhas Pothina
Ben,

The matplotlib on the other working machine is using python 2.6.4. On this 
machine I am using python 2.6.5.

The default python on both machines in python 2.4 but I set up python 2.6 as an 
alternate install in /opt/python26.

- dharhas


 Benjamin Root ben.r...@ou.edu 6/7/2010 3:56 PM 
Dharhas,

Is it possible to find out which version of python was installed for your
other RHEL5 machine?  I don't know if that makes a difference or not, but
RHEL5 by default uses Python 2.4.

Ben Root


On Mon, Jun 7, 2010 at 1:48 PM, Dharhas Pothina 
dharhas.poth...@twdb.state.tx.us wrote:

 Hi,

 I have Python 2.6 installed on RHEL5 (and Numpy 1.4.1) and am trying to
 install matplotlib. Installation occurs without any error messages although
 I do get a bunch of warnings at the end.

 /usr/bin/ld: skipping incompatible /usr/lib/libtk8.4.so when searching for
 -ltk8.4
 /usr/bin/ld: skipping incompatible /usr/lib/libtcl8.4.so when searching
 for -ltcl8.4
 /usr/bin/ld: skipping incompatible /usr/lib/libfreetype.so when searching
 for -lfreetype
 /usr/bin/ld: skipping incompatible /usr/lib/libz.so when searching for -lz
 /usr/bin/ld: skipping incompatible /usr/lib/libz.a when searching for -lz
 /usr/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
 /usr/bin/ld: skipping incompatible /usr/lib/libm.a when searching for -lm
 /usr/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
 /usr/bin/ld: skipping incompatible /usr/lib/libm.a when searching for -lm
 /usr/bin/ld: skipping incompatible /usr/lib/libpthread.so when searching
 for -lpthread
 /usr/bin/ld: skipping incompatible /usr/lib/libpthread.a when searching for
 -lpthread
 /usr/bin/ld: skipping incompatible /usr/lib/libc.so when searching for -lc
 /usr/bin/ld: skipping incompatible /usr/lib/libc.a when searching for -lc

 When I try using matplotlib I get the following error:

 Python 2.6.5 (r265:79063, May 18 2010, 11:20:57)
 [GCC 4.1.2 20080704 (Red Hat 4.1.2-48)] on linux2
 Type help, copyright, credits or license for more information.
  import matplotlib.pyplot as plt
  plt.plot([1,0],[2,3])
 Traceback (most recent call last):
  File stdin, line 1, in module
  File
 /home/swdata/.virtualenvs/web/lib/python2.6/site-packages/matplotlib/pyplot.py,
 line 2141, in plot
ret = ax.plot(*args, **kwargs)
  File
 /home/swdata/.virtualenvs/web/lib/python2.6/site-packages/matplotlib/axes.py,
 line 3437, in plot
self.autoscale_view(scalex=scalex, scaley=scaley)
  File
 /home/swdata/.virtualenvs/web/lib/python2.6/site-packages/matplotlib/axes.py,
 line 1624, in autoscale_view
XL = self.xaxis.get_major_locator().view_limits(x0, x1)
  File
 /home/swdata/.virtualenvs/web/lib/python2.6/site-packages/matplotlib/ticker.py,
 line 1014, in view_limits
return np.take(self.bin_boundaries(dmin, dmax), [0,-1])
  File
 /home/swdata/.virtualenvs/web/lib/python2.6/site-packages/numpy/core/fromnumeric.py,
 line 103, in take
return take(indices, axis, out, mode)
 IndexError: index out of range for array


 Any help would be appreciated. I've tried several versions of matplotlib. I
 also was able to get it installed on a different RHEL5 machine a while back
 and am not sure what is different about this machine.

 thanks

 - dharhas


 --
 ThinkGeek and WIRED's GeekDad team up for the Ultimate
 GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
 lucky parental unit.  See the prize list and enter to win:
 http://p.sf.net/sfu/thinkgeek-promo 
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net 
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users 



--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] easy_install in virtualenv -- error: command 'gcc' failed with exit status 1

2010-06-07 Thread Robert Sudwarts
Hi,

Hoping someone can help with this... I'm trying to install in a virtual
environment created with --no-site-packages
I've followed all instructions re cleaning the existing .matplotlib
cache/directory and deleted .egg files etc

(virtualenv) ... $ easy_install matplotlib  -- gives me an error: command
'gcc' failed with exit status 1

The existing components (note: all from within the virtualenv):

$ python --version  -- 2.6.4

$ python -c 'import numpy; print numpy.__version__'--   1.4.1

$ gcc --version  -- 4.4.1

$ uname -a  --  Linux HP-desktop 2.6.31-22-generic-pae #60-Ubuntu SMP
Thu May 27 01:40:15 UTC 2010 i686 GNU/Linux

(I'm running this on Ubuntu Karmic Koala -- please note that installing from
the Synaptic Package Manager gives me a working version which runs correctly
and as expected, using  ipython -pylab etc)

This may be a question of downloading a version other than v0.99.3 but in
that case I'd not be sure which one to use(!)
I'd be really grateful for any assistance you can give



(and finally the output/error from easy_install matplotlib)

Searching for matplotlib
Reading http://pypi.python.org/simple/matplotlib/
Reading http://matplotlib.sourceforge.net
Reading
http://sourceforge.net/project/showfiles.php?group_id=80706package_id=82474
Reading
https://sourceforge.net/project/showfiles.php?group_id=80706package_id=278194
Reading http://sourceforge.net/project/showfiles.php?group_id=80706
Reading
https://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-0.99.1/
Reading
https://sourceforge.net/project/showfiles.php?group_id=80706package_id=82474
Best match: matplotlib 0.99.3
Downloading
http://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-0.99.3/matplotlib-0.99.3.tar.gz/download
Processing download
Running matplotlib-0.99.3/setup.py -q bdist_egg --dist-dir
/tmp/easy_install-7FYGk8/matplotlib-0.99.3/egg-dist-tmp-7gnrbR

BUILDING MATPLOTLIB
matplotlib: 0.99.3
python: 2.6.4 (r264:75706, Dec  7 2009, 18:45:15)  [GCC
4.4.1]
  platform: linux2

REQUIRED DEPENDENCIES
 numpy: 1.4.1
 freetype2: found, but unknown version (no pkg-config)
* WARNING: Could not find 'freetype2' headers in any
* of '/usr/local/include', '/usr/include', '.',
* '/usr/local/include/freetype2',
* '/usr/include/freetype2', './freetype2'.

OPTIONAL BACKEND DEPENDENCIES
libpng: found, but unknown version (no pkg-config)
* Could not find 'libpng' headers in any of
* '/usr/local/include', '/usr/include', '.'
   Tkinter: no
* Using default library and include directories for
* Tcl and Tk because a Tk window failed to open.
* You may need to define DISPLAY for Tk to work so
* that setup can determine where your libraries are
* located. Tkinter present, but header files are not
* found. You may need to install development
* packages.
  wxPython: no
* wxPython not found
  Gtk+: no
* Building for Gtk+ requires pygtk; you must be able
* to import gtk in your build/install environment
   Mac OS X native: no
Qt: no
   Qt4: no
 Cairo: no

OPTIONAL DATE/TIMEZONE DEPENDENCIES
  datetime: present, version unknown
  dateutil: matplotlib will provide
  pytz: matplotlib will provide
adding pytz

OPTIONAL USETEX DEPENDENCIES
dvipng: no
   ghostscript: 8.70
 latex: no
   pdftops: 0.12.0

[Edit setup.cfg to suppress the above messages]

pymods ['pylab']
packages ['matplotlib', 'matplotlib.backends', 'matplotlib.projections',
'mpl_toolkits', 'mpl_toolkits.mplot3d', 'mpl_toolkits.axes_grid',
'matplotlib.sphinxext', 'matplotlib.numerix', 'matplotlib.numerix.mlab', '
matplotlib.numerix.ma', 'matplotlib.numerix.linear_algebra',
'matplotlib.numerix.random_array', 'matplotlib.numerix.fft',
'matplotlib.delaunay', 'pytz', 'dateutil', 'dateutil/zoneinfo']
warning: no files found matching 'MANIFEST'
warning: no files found matching 'lib/mpl_toolkits'
cc1plus: warning: command line option -Wstrict-prototypes is valid for
Ada/C/ObjC but not for C++
In file included from /usr/include/c++/4.4/ext/hash_map:59,
 from ./CXX/Extensions.hxx:68,
 from src/ft2font.h:4,
 from src/ft2font.cpp:1:
/usr/include/c++/4.4/backward/backward_warning.h:28:2: warning: 

Re: [Matplotlib-users] easy_install in virtualenv -- error: command 'gcc' failed with exit status 1

2010-06-07 Thread Eric Firing
On 06/07/2010 01:15 PM, Robert Sudwarts wrote:
 Hi,

 Hoping someone can help with this... I'm trying to install in a virtual
 environment created with --no-site-packages
 I've followed all instructions re cleaning the existing .matplotlib
 cache/directory and deleted .egg files etc

 (virtualenv) ... $ easy_install matplotlib  -- gives me an error:
 command 'gcc' failed with exit status 1

 The existing components (note: all from within the virtualenv):

 $ python --version  -- 2.6.4

 $ python -c 'import numpy; print numpy.__version__'--   1.4.1

 $ gcc --version  -- 4.4.1

 $ uname -a  --  Linux HP-desktop 2.6.31-22-generic-pae #60-Ubuntu
 SMP Thu May 27 01:40:15 UTC 2010 i686 GNU/Linux

 (I'm running this on Ubuntu Karmic Koala -- please note that installing
 from the Synaptic Package Manager gives me a working version which runs
 correctly and as expected, using  ipython -pylab etc)

 This may be a question of downloading a version other than v0.99.3 but
 in that case I'd not be sure which one to use(!)
 I'd be really grateful for any assistance you can give

It looks like the problem is that you are missing the -dev packages for 
various libraries.  In your output below, wherever you see something 
about a missing header, it means you need to install a corresponding 
-dev package.

Eric




 (and finally the output/error from easy_install matplotlib)

 Searching for matplotlib
 Reading http://pypi.python.org/simple/matplotlib/
 Reading http://matplotlib.sourceforge.net
 Reading
 http://sourceforge.net/project/showfiles.php?group_id=80706package_id=82474
 http://sourceforge.net/project/showfiles.php?group_id=80706package_id=82474
 Reading
 https://sourceforge.net/project/showfiles.php?group_id=80706package_id=278194
 https://sourceforge.net/project/showfiles.php?group_id=80706package_id=278194
 Reading http://sourceforge.net/project/showfiles.php?group_id=80706
 Reading
 https://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-0.99.1/
 Reading
 https://sourceforge.net/project/showfiles.php?group_id=80706package_id=82474
 https://sourceforge.net/project/showfiles.php?group_id=80706package_id=82474
 Best match: matplotlib 0.99.3
 Downloading
 http://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-0.99.3/matplotlib-0.99.3.tar.gz/download
 Processing download
 Running matplotlib-0.99.3/setup.py -q bdist_egg --dist-dir
 /tmp/easy_install-7FYGk8/matplotlib-0.99.3/egg-dist-tmp-7gnrbR
 
 BUILDING MATPLOTLIB
  matplotlib: 0.99.3
  python: 2.6.4 (r264:75706, Dec  7 2009, 18:45:15)  [GCC
  4.4.1]
platform: linux2

 REQUIRED DEPENDENCIES
   numpy: 1.4.1
   freetype2: found, but unknown version (no pkg-config)
  * WARNING: Could not find 'freetype2' headers
 in any
  * of '/usr/local/include', '/usr/include', '.',
  * '/usr/local/include/freetype2',
  * '/usr/include/freetype2', './freetype2'.

 OPTIONAL BACKEND DEPENDENCIES
  libpng: found, but unknown version (no pkg-config)
  * Could not find 'libpng' headers in any of
  * '/usr/local/include', '/usr/include', '.'
 Tkinter: no
  * Using default library and include directories for
  * Tcl and Tk because a Tk window failed to open.
  * You may need to define DISPLAY for Tk to work so
  * that setup can determine where your libraries are
  * located. Tkinter present, but header files
 are not
  * found. You may need to install development
  * packages.
wxPython: no
  * wxPython not found
Gtk+: no
  * Building for Gtk+ requires pygtk; you must be
 able
  * to import gtk in your build/install environment
 Mac OS X native: no
  Qt: no
 Qt4: no
   Cairo: no

 OPTIONAL DATE/TIMEZONE DEPENDENCIES
datetime: present, version unknown
dateutil: matplotlib will provide
pytz: matplotlib will provide
 adding pytz

 OPTIONAL USETEX DEPENDENCIES
  dvipng: no
 ghostscript: 8.70
   latex: no
 pdftops: 0.12.0

 [Edit setup.cfg to suppress the above messages]
 
 pymods ['pylab']
 packages ['matplotlib', 'matplotlib.backends', 'matplotlib.projections',
 'mpl_toolkits', 'mpl_toolkits.mplot3d', 'mpl_toolkits.axes_grid',
 'matplotlib.sphinxext', 'matplotlib.numerix', 

Re: [Matplotlib-users] easy_install in virtualenv -- error: command 'gcc' failed with exit status 1

2010-06-07 Thread Robert Sudwarts
Thanks for your quick response Eric -- I've just spotted the freetype 
libpng packages which will also need to be installed...

... and having downloaded freetype etc (and seen its rather interesting
installation instructions...) I'll have to figure out how to get this to end
up in the right place!

Thanks for your help.

Rob







On 8 June 2010 00:15, Robert Sudwarts robert.sudwa...@gmail.com wrote:

 Hi,

 Hoping someone can help with this... I'm trying to install in a virtual
 environment created with --no-site-packages
 I've followed all instructions re cleaning the existing .matplotlib
 cache/directory and deleted .egg files etc

 (virtualenv) ... $ easy_install matplotlib  -- gives me an error: command
 'gcc' failed with exit status 1

 The existing components (note: all from within the virtualenv):

 $ python --version  -- 2.6.4

 $ python -c 'import numpy; print numpy.__version__'--   1.4.1

 $ gcc --version  -- 4.4.1

 $ uname -a  --  Linux HP-desktop 2.6.31-22-generic-pae #60-Ubuntu SMP
 Thu May 27 01:40:15 UTC 2010 i686 GNU/Linux

 (I'm running this on Ubuntu Karmic Koala -- please note that installing
 from the Synaptic Package Manager gives me a working version which runs
 correctly and as expected, using  ipython -pylab etc)

 This may be a question of downloading a version other than v0.99.3 but in
 that case I'd not be sure which one to use(!)
 I'd be really grateful for any assistance you can give



 (and finally the output/error from easy_install matplotlib)

 Searching for matplotlib
 Reading http://pypi.python.org/simple/matplotlib/
 Reading http://matplotlib.sourceforge.net
 Reading
 http://sourceforge.net/project/showfiles.php?group_id=80706package_id=82474
 Reading
 https://sourceforge.net/project/showfiles.php?group_id=80706package_id=278194
 Reading http://sourceforge.net/project/showfiles.php?group_id=80706
 Reading
 https://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-0.99.1/
 Reading
 https://sourceforge.net/project/showfiles.php?group_id=80706package_id=82474
 Best match: matplotlib 0.99.3
 Downloading
 http://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-0.99.3/matplotlib-0.99.3.tar.gz/download
 Processing download
 Running matplotlib-0.99.3/setup.py -q bdist_egg --dist-dir
 /tmp/easy_install-7FYGk8/matplotlib-0.99.3/egg-dist-tmp-7gnrbR

 
 BUILDING MATPLOTLIB
 matplotlib: 0.99.3
 python: 2.6.4 (r264:75706, Dec  7 2009, 18:45:15)  [GCC
 4.4.1]
   platform: linux2

 REQUIRED DEPENDENCIES
  numpy: 1.4.1
  freetype2: found, but unknown version (no pkg-config)
 * WARNING: Could not find 'freetype2' headers in
 any
 * of '/usr/local/include', '/usr/include', '.',
 * '/usr/local/include/freetype2',
 * '/usr/include/freetype2', './freetype2'.

 OPTIONAL BACKEND DEPENDENCIES
 libpng: found, but unknown version (no pkg-config)
 * Could not find 'libpng' headers in any of
 * '/usr/local/include', '/usr/include', '.'
Tkinter: no
 * Using default library and include directories for
  * Tcl and Tk because a Tk window failed to open.
 * You may need to define DISPLAY for Tk to work so
 * that setup can determine where your libraries are
 * located. Tkinter present, but header files are
 not
 * found. You may need to install development
 * packages.
   wxPython: no
 * wxPython not found
   Gtk+: no
 * Building for Gtk+ requires pygtk; you must be
 able
 * to import gtk in your build/install environment
Mac OS X native: no
 Qt: no
Qt4: no
  Cairo: no

 OPTIONAL DATE/TIMEZONE DEPENDENCIES
   datetime: present, version unknown
   dateutil: matplotlib will provide
   pytz: matplotlib will provide
 adding pytz

 OPTIONAL USETEX DEPENDENCIES
 dvipng: no
ghostscript: 8.70
  latex: no
pdftops: 0.12.0

 [Edit setup.cfg to suppress the above messages]

 
 pymods ['pylab']
 packages ['matplotlib', 'matplotlib.backends', 'matplotlib.projections',
 'mpl_toolkits', 'mpl_toolkits.mplot3d', 'mpl_toolkits.axes_grid',
 'matplotlib.sphinxext', 'matplotlib.numerix', 'matplotlib.numerix.mlab', '
 matplotlib.numerix.ma', 'matplotlib.numerix.linear_algebra',
 'matplotlib.numerix.random_array', 'matplotlib.numerix.fft',
 

[Matplotlib-users] better way to change spine and ticklabel colors?

2010-06-07 Thread Paul Ivanov
Hi all,

I've really been enjoying matplotlib, but in getting my graphs to look just
the way I want, I find myself having to just through some hoops to get
there.

my question is: is there a better way of changing spine, tick, and
ticklabels colors?

Here's what I use right now:

[s.set_color(color) for s in ax.spines.values()]
[s.set_color(color) for s in ax.yaxis.get_ticklines()]
[s.set_color(color) for s in ax.xaxis.get_ticklines()]
[(s.set_color(color),s.set_size(8)) for s in ax.xaxis.get_ticklabels()]
[(s.set_color(color),s.set_size(8)) for s in ax.yaxis.get_ticklabels()]
ax.yaxis.grid(which='major',linestyle='-',color=color,alpha=.3)

I realize that I should probably set the rcParam equivalents before creating
ax. But once I have an axesSubplot ax, what's the best way to fiddle with
these parameters?

you can see a full example here:
http://pirsquared.org/blog/2010/06/07/ca-prop/

best,
Paul Ivanov

-- 
I only use the 314 gmail account for mailinglists. Please send off-list
personal correspondence to my initials (two letters) at berkeley dot edu.
--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Custom data transformations with log ticks

2010-06-07 Thread Shareef Dabdoub
Hello All,

I have data that I need to apply log-based transformations to followed
by plotting. Ideally I would like the plot to display the nicely
formatted log-scale major/minor ticks as when setting xscale('log').
Of course, doing that applies the default log transformation to
already log-transformed data.

I played around with the matplotlib.ticker classes, but the LogLocator
only seems to work properly when applied to a plot with axes set to
log scale or plotted with something like semilog (as in
http://old.nabble.com/ticks---labels-td18931344.html).

An example:

import matplotlib.pyplot as plt
import matplotlib.ticker as mt
import numpy as np

x = [10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 200, 300, 400, 500, 600,
700, 800, 900, 1000, 2000, 3000, 4000, 5000, 6000, 7000, 8000, 9000,
1]
xlog = np.log10(x)   #or some other more complex transform
y = [1 for i in x]

fig = plt.figure()
ax = fig.add_subplot(111)
ax.plot(xlog,y, '.', c='blue', ms=2)
ax.xaxis.set_major_locator(mt.LogLocator())
plt.show()

Resulting in: http://imgur.com/MtsLE.png
As opposed to what I would like: http://imgur.com/QELVD.png (plotting
x instead of xlog, and ax.set_xscale('log'))

I'm probably missing something simple, but I haven't been able to
figure it out as of yet.

Thanks in advance for any suggestions/help.
Shareef

--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] better way to change spine and ticklabel colors?

2010-06-07 Thread Benjamin Root
I would like to second this sentiment.  I just encountered a situation today
where I needed to modify the fontsize of the ticklabels and I could not find
any obvious method for modifying the properties.  Unless I am mistaken and
there are methods for this, shall I file a feature request?

Ben Root

On Mon, Jun 7, 2010 at 7:55 PM, Paul Ivanov pivanov...@gmail.com wrote:

 Hi all,

 I've really been enjoying matplotlib, but in getting my graphs to look just
 the way I want, I find myself having to just through some hoops to get
 there.

 my question is: is there a better way of changing spine, tick, and
 ticklabels colors?

 Here's what I use right now:

 [s.set_color(color) for s in ax.spines.values()]
 [s.set_color(color) for s in ax.yaxis.get_ticklines()]
 [s.set_color(color) for s in ax.xaxis.get_ticklines()]
 [(s.set_color(color),s.set_size(8)) for s in ax.xaxis.get_ticklabels()]
 [(s.set_color(color),s.set_size(8)) for s in ax.yaxis.get_ticklabels()]
 ax.yaxis.grid(which='major',linestyle='-',color=color,alpha=.3)

 I realize that I should probably set the rcParam equivalents before
 creating ax. But once I have an axesSubplot ax, what's the best way to
 fiddle with these parameters?

 you can see a full example here:
 http://pirsquared.org/blog/2010/06/07/ca-prop/

 best,
 Paul Ivanov

 --
 I only use the 314 gmail account for mailinglists. Please send off-list
 personal correspondence to my initials (two letters) at berkeley dot edu.


 --
 ThinkGeek and WIRED's GeekDad team up for the Ultimate
 GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
 lucky parental unit.  See the prize list and enter to win:
 http://p.sf.net/sfu/thinkgeek-promo
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] easy_install in virtualenv -- error: command 'gcc' failed with exit status 1

2010-06-07 Thread Eric Firing
On 06/07/2010 02:36 PM, Robert Sudwarts wrote:
 Thanks for your quick response Eric -- I've just spotted the freetype 
 libpng packages which will also need to be installed...

 ... and having downloaded freetype etc (and seen its rather interesting
 installation instructions...) I'll have to figure out how to get this to
 end up in the right place!

I would (and do) just install these library dependencies and their -dev 
versions via the usual ubuntu package system, so it should be very 
simple.  There is no need to install them from source.

Eric


 Thanks for your help.

 Rob







 On 8 June 2010 00:15, Robert Sudwarts robert.sudwa...@gmail.com
 mailto:robert.sudwa...@gmail.com wrote:

 Hi,

 Hoping someone can help with this... I'm trying to install in a
 virtual environment created with --no-site-packages
 I've followed all instructions re cleaning the existing .matplotlib
 cache/directory and deleted .egg files etc

 (virtualenv) ... $ easy_install matplotlib  -- gives me an error:
 command 'gcc' failed with exit status 1

 The existing components (note: all from within the virtualenv):

 $ python --version  -- 2.6.4

 $ python -c 'import numpy; print numpy.__version__'--   1.4.1

 $ gcc --version  -- 4.4.1

 $ uname -a  --  Linux HP-desktop 2.6.31-22-generic-pae
 #60-Ubuntu SMP Thu May 27 01:40:15 UTC 2010 i686 GNU/Linux

 (I'm running this on Ubuntu Karmic Koala -- please note that
 installing from the Synaptic Package Manager gives me a working
 version which runs correctly and as expected, using  ipython -pylab etc)

 This may be a question of downloading a version other than v0.99.3
 but in that case I'd not be sure which one to use(!)
 I'd be really grateful for any assistance you can give



 (and finally the output/error from easy_install matplotlib)

 Searching for matplotlib
 Reading http://pypi.python.org/simple/matplotlib/
 Reading http://matplotlib.sourceforge.net
 Reading
 
 http://sourceforge.net/project/showfiles.php?group_id=80706package_id=82474
 
 http://sourceforge.net/project/showfiles.php?group_id=80706package_id=82474
 Reading
 
 https://sourceforge.net/project/showfiles.php?group_id=80706package_id=278194
 
 https://sourceforge.net/project/showfiles.php?group_id=80706package_id=278194
 Reading http://sourceforge.net/project/showfiles.php?group_id=80706
 Reading
 
 https://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-0.99.1/
 Reading
 
 https://sourceforge.net/project/showfiles.php?group_id=80706package_id=82474
 
 https://sourceforge.net/project/showfiles.php?group_id=80706package_id=82474
 Best match: matplotlib 0.99.3
 Downloading
 
 http://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-0.99.3/matplotlib-0.99.3.tar.gz/download
 Processing download
 Running matplotlib-0.99.3/setup.py -q bdist_egg --dist-dir
 /tmp/easy_install-7FYGk8/matplotlib-0.99.3/egg-dist-tmp-7gnrbR
 
 
 BUILDING MATPLOTLIB
  matplotlib: 0.99.3
  python: 2.6.4 (r264:75706, Dec  7 2009, 18:45:15)  [GCC
  4.4.1]
platform: linux2

 REQUIRED DEPENDENCIES
   numpy: 1.4.1
   freetype2: found, but unknown version (no pkg-config)
  * WARNING: Could not find 'freetype2'
 headers in any
  * of '/usr/local/include', '/usr/include', '.',
  * '/usr/local/include/freetype2',
  * '/usr/include/freetype2', './freetype2'.

 OPTIONAL BACKEND DEPENDENCIES
  libpng: found, but unknown version (no pkg-config)
  * Could not find 'libpng' headers in any of
  * '/usr/local/include', '/usr/include', '.'
 Tkinter: no
  * Using default library and include
 directories for
  * Tcl and Tk because a Tk window failed to
 open.
  * You may need to define DISPLAY for Tk to
 work so
  * that setup can determine where your
 libraries are
  * located. Tkinter present, but header
 files are not
  * found. You may need to install development
  * packages.
wxPython: no
  * wxPython not found
Gtk+: no
  * Building for Gtk+ requires pygtk; you
 must be able
  * to import gtk in your build/install
 environment
 Mac OS X native: no
  Qt: no

Re: [Matplotlib-users] better way to change spine and ticklabel colors?

2010-06-07 Thread Eric Firing
On 06/07/2010 04:31 PM, Benjamin Root wrote:
 I would like to second this sentiment.  I just encountered a situation
 today where I needed to modify the fontsize of the ticklabels and I
 could not find any obvious method for modifying the properties.  Unless
 I am mistaken and there are methods for this, shall I file a feature
 request?

I'm already working on it, and have the low level parts done.  I just 
have to put in the higher-level API and commit it.

Eric


 Ben Root

 On Mon, Jun 7, 2010 at 7:55 PM, Paul Ivanov pivanov...@gmail.com
 mailto:pivanov...@gmail.com wrote:

 Hi all,

 I've really been enjoying matplotlib, but in getting my graphs to
 look just the way I want, I find myself having to just through some
 hoops to get there.

 my question is: is there a better way of changing spine, tick, and
 ticklabels colors?

 Here's what I use right now:

  [s.set_color(color) for s in ax.spines.values()]
  [s.set_color(color) for s in ax.yaxis.get_ticklines()]
  [s.set_color(color) for s in ax.xaxis.get_ticklines()]
  [(s.set_color(color),s.set_size(8)) for s in
 ax.xaxis.get_ticklabels()]
  [(s.set_color(color),s.set_size(8)) for s in
 ax.yaxis.get_ticklabels()]
  ax.yaxis.grid(which='major',linestyle='-',color=color,alpha=.3)

 I realize that I should probably set the rcParam equivalents before
 creating ax. But once I have an axesSubplot ax, what's the best way
 to fiddle with these parameters?

 you can see a full example here:
 http://pirsquared.org/blog/2010/06/07/ca-prop/

 best,
 Paul Ivanov

 --
 I only use the 314 gmail account for mailinglists. Please send
 off-list personal correspondence to my initials (two letters) at
 berkeley dot edu.

 
 --
 ThinkGeek and WIRED's GeekDad team up for the Ultimate
 GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
 lucky parental unit.  See the prize list and enter to win:
 http://p.sf.net/sfu/thinkgeek-promo
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 mailto:Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users




 --
 ThinkGeek and WIRED's GeekDad team up for the Ultimate
 GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
 lucky parental unit.  See the prize list and enter to win:
 http://p.sf.net/sfu/thinkgeek-promo



 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Help with imshow on Mac OS X 10.6 Snow Leopoard

2010-06-07 Thread Todd V Rovito
Ben,
   That worked great, thanks!!!  Just a few points.  The documentation under
the image tutorial section does not specify that a user has to do
plt.show(), should I submit a bug report or something?  I changed my code
and listed it below it works as long as I comment out the plot c section.
In other words if I perform a normal 2d plot then close plot window the
image plot does not product a result.  If I comment out the plot c section
then the image plot works great.  Any ideas?

Even the stink bug example is working when I read a image from disk.
Thanks.


# -*- coding: utf-8 -*-
from numpy import *
import matplotlib.pyplot as plt
import matplotlib.image as mpimg

print Numpy version:  + __version__

a = array([10,20,30,40])
print result of a
print a

b = arange(4)
print result of b
print b

c = linspace(-pi, pi, 30)
print result of c
print c

# this plot code works
print plot c
plt.plot(c)
plt.ylabel(-pi to + pi)
plt.xlabel(value of c)
plt.show()

# this image processing code does not work
print doing image processing stuff
img=mpimg.imread(/Users/rovitotv/Desktop/stinkbug.png) # this does not
work
##img = zeros((10, 10), dtype=uint8)
##for i in range(10):
##img[i,i] = 255;

plt.imshow(img)
plt.show()
print data type of img:
print img.dtype
print size of img: + str(img.size)
print img



On Mon, Jun 7, 2010 at 10:04 AM, Benjamin Root ben.r...@ou.edu wrote:

 Todd,

 I think you are missing a plt.show() at the end of your code.
 matplotlib, by default on most systems, does not show a plot until you tell
 it to using plt.show() command.

 See if that works,
 Ben Root

   On Mon, Jun 7, 2010 at 7:57 AM, Todd V Rovito rovit...@gmail.comwrote:

   Greetings,
 I just installed Python 2.6 (python.org), Numpy 1.4.1, and Matplotlib
 0.99.1.2 all on Mac OS X 10.6 in an attempt to learn about scientific
 programming in python.  Go easy on me since I am a begginer.  The Python and
 Numpy seem to be working correctly.  I can get matplotlib to make plots but
 I can't get it to show images.  I tried the stinkbug example in
 the Matplotlib users guide documentation with no success.  Errors are _NOT_
 generated but neither are any results on the screen.  The imread command
 produces a float32 matrix that contains all 1. values so I tried creating my
 own uint8 matrix with a diagnoal line.  My code is below.  Thanks for any
 help you can provide.



 # -*- coding: utf-8 -*-
 from numpy import *
 import matplotlib.pyplot as plt
 import matplotlib.image as mpimg

 print Numpy version:  + __version__
 a = array([10,20,30,40])
 print result of a
 print a

 b = arange(4)
 print result of b
 print b

 c = linspace(-pi, pi, 30)
 print result of c
 print c

 # this plot code works
 print plot c
 plt.plot(c)
 plt.ylabel(-pi to + pi)
 plt.xlabel(value of c)
 plt.show()

 # this image processing code does not work
 print doing image processing stuff
 # img=mpimg.imread(/Users/rovitotv/Desktop/stinkbug.png) # this does not
 work
 img = zeros((10, 10), dtype=uint8)
 for i in range(10):
 img[i,i] = 255;

 plt.imshow(img)
 print data type of img:
 print img.dtype
 print size of img: + str(img.size)
 print img




 --
 ThinkGeek and WIRED's GeekDad team up for the Ultimate
 GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
 lucky parental unit.  See the prize list and enter to win:
 http://p.sf.net/sfu/thinkgeek-promo
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users




 --
 ThinkGeek and WIRED's GeekDad team up for the Ultimate
 GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
 lucky parental unit.  See the prize list and enter to win:
 http://p.sf.net/sfu/thinkgeek-promo
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users