Re: [Matplotlib-users] Question(s) for new MAC 10.7 User

2012-02-20 Thread Nicolas Le Bihan
Hi William,
I have also spent some time to have a numpy/scipy/matplotlib set working under 
mac os X lion (10.7.3)
I use python 2.7.2, and work with ipython (0.12) in pylab mode. 
I finally did a mixture of several posts on forums and got it to work properly 
now. 

Here is the recipe :

1 - Install homebrew (and remove macport and fink) and easy-install / pip

2 - Install python, gfortran and pkg-config using homebrew  
With homebrew, everything should be installed in /usr/local/Cellar

3 - Install ipython (0.12) and numpy (1.6.1) with homebrew 

4 - Scipy install (version 0.11.0.dev-e857412 ) : 

pip install -e git+https://github.com/scipy/scipy#egg=scipy-dev 

It automatically installs scipy in /Users/nicolas/src and link it to 
/usr/local/Cellar/

5 - Matplotlib install (dev as well 1.2.x): 

sudo make -f make.osx PREFIX=/Users/nicolas/src PYVERSION=2.7 fetch deps 
mpl_install_std

It also instal in /Users/yourname/src/
It also 

6 - add to your .bash_profile the following : 

export PATH=/usr/local/bin:$PATH
export PATH=/usr/local/share/python:$PATH
export PYTHONPATH=/usr/local/lib/python:$PYTHONPATH


The "not very nice and clean" art is that I have a /src folder (which contains 
numpy) and a /matplotilib folder in my /Users/nicolas 

I hope it helps.

Nicolas

On 20 févr. 2012, at 21:17, William Jennings wrote:

>  Hello mat plot lib users! 
> 
> I feel quite embarrassed that I’ve gone through 2 days of trying to get to 
> get numpy, scipy and matplotlib all to work nice with each other. I’ve 
> scraped through forums, stackoverflow and all the links that can bide me some 
> type of logic. Yet, alas I still fail wildly with this set of errors:
> 
> my current status is: just did a fresh install of my lion os and haven't 
> installed Xcode yet. I'm a little lost and have found only macports, homebrew 
> guides online only to be a slower failure. I really need to use this software 
> but I'm finding it difficult keeping straight what order and what I need to 
> install. Is it best to have python 2.6 or 2.72? if it's 2.72 should it be the 
> universal version from python.org? Once that is installed is it best to just 
> install numpy and scipy from github and then try matplotlib? I know I need to 
> install fortran and make sure that it's using G++ 4.2 and C++ 4.2 BEFORE i 
> run scipy and numpy setup... Yet, right now I'm floundering for a clear 
> example on 10 or so commands I should put into terminal and in the correct 
> order for how to install it. I promise once I learn how to install I'll put a 
> resource on the web or link back to some of the better resources. As for now 
> my freshly installed os computer is in your hands currently with python 2.71 
> that was preinstalled with Lion. That is all I've done thus far. 
> 
> Thank you !
> 
> Here is the old error I was getting when I used the home brew guide that I 
> found here: bit.ly/qGdKy9 
> In file included from src/backend_agg.cpp:11:
> In file included from src/_backend_agg.h:34:
> agg24/include/agg_renderer_outline_aa.h:1368:45: error: binding of reference 
> to type ‘agg::line_profile_aa’ to a value of type ‘const 
> agg::line_profile_aa’ drops qualifiers
> line_profile_aa& profile() { return *m_profile; }
> ^~
> 1 error generated.
> error: command ‘/usr/bin/clang’ failed with exit status 1
> —-
> Command /Users/Will/.virtualenvs/test1/bin/python -c “import 
> setuptools;file=’/Users/Will/.virtualenvs/test1/src/matplotlib/setup.py’; 
> exec(compile(open(file).read().replace(‘\r\n’, ‘\n’), file, ‘exec’))” develop 
> –no-deps failed with error code 1 in 
> /Users/Will/.virtualenvs/test1/src/matplotlib
> Storing complete log in /Users/Will/.pip/pip.log
> --
> Keep Your Developer Skills Current with LearnDevNow!
> The most comprehensive online learning library for Microsoft developers
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-d2d___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib installation and ?'s

2012-02-20 Thread Eric Firing
On 02/20/2012 07:07 PM, William Jennings wrote:
> Hello mat plot lib users!
>
> I feel quite embarrassed that I’ve gone through 2 days of trying to get
> to get numpy, scipy and matplotlib all to work nice with each other.
> I’ve scraped through forums, stackoverflow and all the links that can
> bide me some type of logic. Yet, alas I still fail wildly with this set
> of errors:
>
> *my current status is: just did a fresh install of my lion os and
> haven't installed Xcode yet. I'm a little lost and have found only
> macports, homebrew guides online only to be a slower failure. I really
> need to use this software but I'm finding it difficult keeping straight
> what order and what I need to install. Is it best to have python 2.6 or
> 2.72? if it's 2.72 should it be the universal version from python.org
> ? Once that is installed is it best to just install
> numpy and scipy from github and then try matplotlib? I know I need to
> install fortran and make sure that it's using G++ 4.2 and C++ 4.2 BEFORE
> i run scipy and numpy setup... Yet, right now I'm floundering for a
> clear example on 10 or so commands I should put into terminal and in the
> correct order for how to install it. I promise once I learn how to
> install I'll put a resource on the web or link back to some of the
> better resources. As for now my freshly installed os computer is in your
> hands currently with python 2.71 that was preinstalled with Lion. That
> is all I've done thus far. *

The Enthought suggestion is a good one.

Another possibility is to install the python 2.7 from the 
http://python.org/download Mac installer (the one for Mac OS X 10.6 and 
10.7), then the corresponding numpy installer (see scipy.org; the 
download would be from 
http://sourceforge.net/projects/numpy/files/NumPy/1.6.1/ and you want 
the one near the bottom, ending in "macosx10.6.dmg"), and last the 
recently added mpl Mac installer for python 2.7, the first file you see 
here:
http://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-1.1.0/

I haven't tried it--I don't have a mac--but I'm pretty sure the above 
set should all work together.

Eric

> *
> *
> *Thank you !*
> *
> *
> *Here is the old error I was getting when I used the home brew guide
> that I found here: *bit.ly/qGdKy9 
>
> In file included from src/backend_agg.cpp:11:
> In file included from src/_backend_agg.h:34:
> agg24/include/agg_renderer_outline_aa.h:1368:45: error: binding of
> reference to type ‘agg::line_profile_aa’ to a value of type ‘const
> agg::line_profile_aa’ drops qualifiers
> line_profile_aa& profile() { return *m_profile; }
> ^~
> 1 error generated.
> error: command ‘/usr/bin/clang’ failed with exit status 1
> —-
> Command /Users/Will/.virtualenvs/test1/bin/python -c “import
> setuptools;*file*=’/Users/Will/.virtualenvs/test1/src/matplotlib/setup.py’;
> exec(compile(open(*file*).read().replace(‘\r\n’, ‘\n’), *file*,
> ‘exec’))” develop –no-deps failed with error code 1 in
> /Users/Will/.virtualenvs/test1/src/matplotlib
> Storing complete log in /Users/Will/.pip/pip.log
>
>
>
> --
> Keep Your Developer Skills Current with LearnDevNow!
> The most comprehensive online learning library for Microsoft developers
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-d2d
>
>
>
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users



--
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib installation and ?'s

2012-02-20 Thread Andre' Walker-Loud
Hi William,

There is a company, Enthought, which offers a free package installer, which 
comes with 6 "essential" python libraries, including matplotlib.

http://www.enthought.com/products/epd_free.php

If you have an "edu" email account (you are an academic, or do academic 
research at a gov lab, like LBL) you can download their full set of libraries

http://www.enthought.com/products/edudownload.php

If not, and you think it is worth it (or can get your company to pay), starting 
at $199 you can download their package installer (and get their tech support).

Couple words about them:  I have no affiliation with them.  Some of their 
original employees were deeply involved in numpy.  They developed a 3D plotting 
library, Mayavi, which is pretty cool.


I am reasonably comfortable with my mac, installing src code etc.  I used to 
install everything myself (back on OS X Tiger).  Then, when I upgraded to Snow 
Leopard, I couldn't get it all to work out - I did an account migration from 
old to new, and then there were some issues (I think) relating to the 32 vs 64 
bit compatibility that I couldn't resolve.  I went to a friend who is good with 
computers to get help - he said "You should just use the Enthought installer - 
its so easy, that is what I do".  That helped me get over feeling like I had to 
do it all myself.  (Of course some day, when I have heaps of free time and no 
pressure from work, I will sort out how to do it all myself again)

I am guessing if you want to link numpy against the full BLAS/LAPACK libraries 
for optimal speed on matrix manipulation etc, then you may need to do the 
installation yourself, including all the fortran libraries.  But at least with 
their package installer, it should work out of the box.  Also, it installs the 
whole suite as a "Framework" in /Library/Frameworks/Python.framework/Versions/ 
with a cleverly chosen Version so as not to mesh with your own installation.  
So you can install there version, based on 2.7 and your own version 2.7 and 
they won't interfere.  You'll just have to relink the /usr/bin/python and 
/usr/local/bin/python to which version you want.


Good luck,

Andre





On Feb 20, 2012, at 9:07 PM, William Jennings wrote:

> Hello mat plot lib users! 
> 
> I feel quite embarrassed that I’ve gone through 2 days of trying to get to 
> get numpy, scipy and matplotlib all to work nice with each other. I’ve 
> scraped through forums, stackoverflow and all the links that can bide me some 
> type of logic. Yet, alas I still fail wildly with this set of errors:
> 
> my current status is: just did a fresh install of my lion os and haven't 
> installed Xcode yet. I'm a little lost and have found only macports, homebrew 
> guides online only to be a slower failure. I really need to use this software 
> but I'm finding it difficult keeping straight what order and what I need to 
> install. Is it best to have python 2.6 or 2.72? if it's 2.72 should it be the 
> universal version from python.org? Once that is installed is it best to just 
> install numpy and scipy from github and then try matplotlib? I know I need to 
> install fortran and make sure that it's using G++ 4.2 and C++ 4.2 BEFORE i 
> run scipy and numpy setup... Yet, right now I'm floundering for a clear 
> example on 10 or so commands I should put into terminal and in the correct 
> order for how to install it. I promise once I learn how to install I'll put a 
> resource on the web or link back to some of the better resources. As for now 
> my freshly installed os computer is in your hands currently with python 2.71 
> that was preinstalled with Lion. That is all I've done thus far. 
> 
> Thank you !
> 
> Here is the old error I was getting when I used the home brew guide that I 
> found here: bit.ly/qGdKy9 
> In file included from src/backend_agg.cpp:11:
> In file included from src/_backend_agg.h:34:
> agg24/include/agg_renderer_outline_aa.h:1368:45: error: binding of reference 
> to type ‘agg::line_profile_aa’ to a value of type ‘const 
> agg::line_profile_aa’ drops qualifiers
> line_profile_aa& profile() { return *m_profile; }
> ^~
> 1 error generated.
> error: command ‘/usr/bin/clang’ failed with exit status 1
> —-
> Command /Users/Will/.virtualenvs/test1/bin/python -c “import 
> setuptools;file=’/Users/Will/.virtualenvs/test1/src/matplotlib/setup.py’; 
> exec(compile(open(file).read().replace(‘\r\n’, ‘\n’), file, ‘exec’))” develop 
> –no-deps failed with error code 1 in 
> /Users/Will/.virtualenvs/test1/src/matplotlib
> Storing complete log in /Users/Will/.pip/pip.log
> --
> Keep Your Developer Skills Current with LearnDevNow!
> The most comprehensive online learning library for Microsoft developers
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-d2d

[Matplotlib-users] matplotlib installation and ?'s

2012-02-20 Thread William Jennings
Hello mat plot lib users!
I feel quite embarrassed that I’ve gone through 2 days of trying to get to
get numpy, scipy and matplotlib all to work nice with each other. I’ve
scraped through forums, stackoverflow and all the links that can bide me
some type of logic. Yet, alas I still fail wildly with this set of errors:

*my current status is: just did a fresh install of my lion os and haven't
installed Xcode yet. I'm a little lost and have found only macports,
homebrew guides online only to be a slower failure. I really need to use
this software but I'm finding it difficult keeping straight what order and
what I need to install. Is it best to have python 2.6 or 2.72? if it's 2.72
should it be the universal version from python.org? Once that is installed
is it best to just install numpy and scipy from github and then try
matplotlib? I know I need to install fortran and make sure that it's using
G++ 4.2 and C++ 4.2 BEFORE i run scipy and numpy setup... Yet, right now
I'm floundering for a clear example on 10 or so commands I should put into
terminal and in the correct order for how to install it. I promise once I
learn how to install I'll put a resource on the web or link back to some of
the better resources. As for now my freshly installed os computer is in
your hands currently with python 2.71 that was preinstalled with Lion. That
is all I've done thus far. *
*
*
*Thank you !*
*
*
*Here is the old error I was getting when I used the home brew guide that I
found here: *bit.ly/qGdKy9

In file included from src/backend_agg.cpp:11:
In file included from src/_backend_agg.h:34:
agg24/include/agg_renderer_outline_aa.h:1368:45: error: binding of
reference to type ‘agg::line_profile_aa’ to a value of type ‘const
agg::line_profile_aa’ drops qualifiers
line_profile_aa& profile() { return *m_profile; }
^~
1 error generated.
error: command ‘/usr/bin/clang’ failed with exit status 1
—-
Command /Users/Will/.virtualenvs/test1/bin/python -c “import setuptools;*
file*=’/Users/Will/.virtualenvs/test1/src/matplotlib/setup.py’;
exec(compile(open(*file*).read().replace(‘\r\n’, ‘\n’), *file*, ‘exec’))”
develop –no-deps failed with error code 1 in
/Users/Will/.virtualenvs/test1/src/matplotlib
Storing complete log in /Users/Will/.pip/pip.log
--
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Cross Section Axes (Not framed)

2012-02-20 Thread Benjamin Root
On Sunday, February 19, 2012, Limping_Twerp wrote:

>
> Hey guys,
>
> how do I configure my plot in a way that there arent framed axes but cross
> -
> section -axes? I talk about this
>
>
>
>   |
>   |
>   |
>   |
>   |
> |__
>   |
>   |
>   |
>   |
>   |
>
> Any help?



Don't have the link on me right now, but search on the mpl website for
"spines", and you should find what you are looking for.  If not, look
through the gallery, I know there is an example there.

Ben Root
--
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] set the axis tick width in matplotlibrc file

2012-02-20 Thread Jeff Blackburne

On Feb 20, 2012, at 4:10 AM, 李颜涛 wrote:

> 
> 
> 
> I try to set the axis tick width in matplotlibrc file,but I could't find the 
> item.
> I want to know whether the tick width can be changed.


I adjust this using
mpl.rcParams['lines.markeredgewidth'] = 1.5  # or whatever value you want

This will also adjust things other than just the tick marks, but hopefully it 
does what you want.

-Jeff


--
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] ScalarFormatter

2012-02-20 Thread Gökhan Sever
Hello,

Stealing a solution from ->
http://old.nabble.com/scientific-notation-in-ticklabels-for-linear-plot-td29993489.html

This seems to produce nicer looking y tick-labels. I tend to switch to
log-scale in cases like yours, but this one provides a clean solution as
well.

import numpy as np
import matplotlib.pyplot as plt
from matplotlib.ticker import FuncFormatter

def scinot(x,pos=None):
if x == 0:
s = '0'
else:
xp = int(np.floor(np.log10(np.abs(x
mn = x/10.**xp
# Here we truncate to 2 significant digits -- may not be enough
# in all cases
s = '$'+str('%.3f'%mn) +'\\times 10^{'+str(xp)+'}$'
return s

A = np.array([[  1.e+00,   0.e+00,  1.99236400e-04],
  [  2.e+00,   1.e+00,  2.00043800e-04],
  [  3.e+00,   2.e+00,  2.00046000e-04],
  [  4.e+00,   3.e+00,  2.00043900e-04]])


fig = plt.figure()
ax = fig.add_subplot(111)
ax.plot(A[:,1],A[:,2])
ax.yaxis.set_major_formatter(FuncFormatter(scinot))
y_min,y_max = ax.get_ylim()
print 'y range', y_max-y_min
plt.show()


On Mon, Feb 20, 2012 at 8:32 AM, Nils Wagner
wrote:

> Hi all,
>
> How can I improve the presentation of yticks for a small y range, e.g.
>
>  y_min,y_max = ax.get_ylim()
>>>
 y_max-y_min

>>> 8.6767e-07
>
> I would like to avoid "+1.992 x 10^{-4}" in the attached figure.
>
> import numpy as np
> import matplotlib.pyplot as plt
> from matplotlib.ticker import ScalarFormatter
> formatter = ScalarFormatter(useMathText=**True)
> formatter.set_scientific(True)
> formatter.set_powerlimits((-**15,15))
> #A = np.loadtxt('trash.dat')
> A = np.array([[  1.e+00,   0.e+00,  1.99236400e-04],
>   [  2.e+00,   1.e+00,  2.00043800e-04],
>   [  3.e+00,   2.e+00,  2.00046000e-04],
>   [  4.e+00,   3.e+00,  2.00043900e-04]])
>
>
> fig = plt.figure()
> ax = fig.add_subplot(111)
> ax.yaxis.set_major_formatter(**formatter)
> ax.plot(A[:,1],A[:,2])
> y_min,y_max = ax.get_ylim()
> print 'y range', y_max-y_min
> plt.show()
>
>
> Nils
>
>
> --
> Try before you buy = See our experts in action!
> The most comprehensive online learning library for Microsoft developers
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-dev2
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>


-- 
Gökhan
--
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] mouseevents raise Singular matrix exception: problem solved

2012-02-20 Thread Edward C. Jones
I use Debian stable. The python-matplotlib package version is 0.99.3-1.

Here is a small program which threw many exceptions whenever I moved the
mouse across the matplotlib display.

#! /usr/bin/env python

import matplotlib
import matplotlib.pyplot as plt

counts = [1, 8, 71]
diffs = range(len(counts))
plt.plot(diffs, counts)
plt.axes([0, 200, 0, 100])
plt.show()

Here is one of the tracebacks:

Exception in Tkinter callback
Traceback (most recent call last):
   File "/usr/lib/python2.6/lib-tk/Tkinter.py", line 1413, in __call__
 return self.func(*args)
   File 
"/usr/lib/pymodules/python2.6/matplotlib/backends/backend_tkagg.py", 
line 246, in motion_notify_event
 FigureCanvasBase.motion_notify_event(self, x, y, guiEvent=event)
   File "/usr/lib/pymodules/python2.6/matplotlib/backend_bases.py", line 
1244, in motion_notify_event
 guiEvent=guiEvent)
   File "/usr/lib/pymodules/python2.6/matplotlib/backend_bases.py", line 
899, in __init__
 LocationEvent.__init__(self, name, canvas, x, y, guiEvent=guiEvent)
   File "/usr/lib/pymodules/python2.6/matplotlib/backend_bases.py", line 
813, in __init__
 axes_list = [a for a in self.canvas.figure.get_axes() if 
a.in_axes(self)]
   File "/usr/lib/pymodules/python2.6/matplotlib/axes.py", line 1538, in 
in_axes
 return self.patch.contains(mouseevent)[0]
   File "/usr/lib/pymodules/python2.6/matplotlib/patches.py", line 502, 
in contains
 x, y = self.get_transform().inverted().transform_point(
   File "/usr/lib/pymodules/python2.6/matplotlib/transforms.py", line 
1430, in inverted
 self._inverted = Affine2D(inv(mtx))
   File "/usr/lib/pymodules/python2.6/numpy/linalg/linalg.py", line 423, 
in inv
 return wrap(solve(a, identity(a.shape[0], dtype=a.dtype)))
   File "/usr/lib/pymodules/python2.6/numpy/linalg/linalg.py", line 306, 
in solve
 raise LinAlgError, 'Singular matrix'
LinAlgError: Singular matrix
A Google search on "matplotlib mouseevent singular matrix" found that
a similar problem was discussed in matplotlib-users on Jul 29, 2008:
"bar plot picker with 0 height data". John Hunter committed a fix:
"svn r5922".  The program that caused the bug in 2008 works on my system.

The problem is:
The docs for matplotlib.pyplot.axes say [left, bottom, width, height] but
the docs for matplotlib.pyplot.axis say [xmin, xmax, ymin, ymax].
I should have used "axis" where I used "axes" which is an easy error to 
make.
I suggest that "axes" should raise an exception if width or height is zero.



--
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Question(s) for new MAC 10.7 User

2012-02-20 Thread William Jennings
 Hello mat plot lib users!
I feel quite embarrassed that I’ve gone through 2 days of trying to get to
get numpy, scipy and matplotlib all to work nice with each other. I’ve
scraped through forums, stackoverflow and all the links that can bide me
some type of logic. Yet, alas I still fail wildly with this set of errors:

*my current status is: just did a fresh install of my lion os and haven't
installed Xcode yet. I'm a little lost and have found only macports,
homebrew guides online only to be a slower failure. I really need to use
this software but I'm finding it difficult keeping straight what order and
what I need to install. Is it best to have python 2.6 or 2.72? if it's 2.72
should it be the universal version from python.org? Once that is installed
is it best to just install numpy and scipy from github and then try
matplotlib? I know I need to install fortran and make sure that it's using
G++ 4.2 and C++ 4.2 BEFORE i run scipy and numpy setup... Yet, right now
I'm floundering for a clear example on 10 or so commands I should put into
terminal and in the correct order for how to install it. I promise once I
learn how to install I'll put a resource on the web or link back to some of
the better resources. As for now my freshly installed os computer is in
your hands currently with python 2.71 that was preinstalled with Lion. That
is all I've done thus far. *
*
*
*Thank you !*
*
*
*Here is the old error I was getting when I used the home brew guide that I
found here: *bit.ly/qGdKy9

In file included from src/backend_agg.cpp:11:
In file included from src/_backend_agg.h:34:
agg24/include/agg_renderer_outline_aa.h:1368:45: error: binding of
reference to type ‘agg::line_profile_aa’ to a value of type ‘const
agg::line_profile_aa’ drops qualifiers
line_profile_aa& profile() { return *m_profile; }
^~
1 error generated.
error: command ‘/usr/bin/clang’ failed with exit status 1
—-
Command /Users/Will/.virtualenvs/test1/bin/python -c “import setuptools;*
file*=’/Users/Will/.virtualenvs/test1/src/matplotlib/setup.py’;
exec(compile(open(*file*).read().replace(‘\r\n’, ‘\n’), *file*, ‘exec’))”
develop –no-deps failed with error code 1 in
/Users/Will/.virtualenvs/test1/src/matplotlib
Storing complete log in /Users/Will/.pip/pip.log
--
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] errorbar uplims and lolims reversed?

2012-02-20 Thread yamiddu


Hi all,
 I just tried to use the uplims=True option in matplotlib errorbars to plot
some upper limits, and it turns out that the arrow is upward directed...
Now, an upper limit should mean that the measurement of a certain quantity
has excluded all higher values and that the true value may be smaller than
the limit set, i.e. the arrow should be directed downward.
Isn't it?
same thing for the lolims option, in that case arrows should be directed
upwards.

or is there something I'm missing?


-- 
View this message in context: 
http://old.nabble.com/errorbar-uplims-and-lolims-reversed--tp33352206p33352206.html
Sent from the matplotlib - users mailing list archive at Nabble.com.


--
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Cross Section Axes (Not framed)

2012-02-20 Thread Limping_Twerp

Hey guys,

how do I configure my plot in a way that there arent framed axes but cross -
section -axes? I talk about this



   |
   |
   |
   |
   |
|__
   |
   |
   |
   |
   |

Any help?
-- 
View this message in context: 
http://old.nabble.com/Cross-Section-Axes-%28Not-framed%29-tp33353010p33353010.html
Sent from the matplotlib - users mailing list archive at Nabble.com.


--
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] mouseevents raise Singular matrix exception

2012-02-20 Thread Edward C. Jones
I use Debian stable. The python-matplotlib package version is 0.99.3-1.

Here is a small program which threw many exceptions whenever I moved the
mouse across the matplotlib display.

#! /usr/bin/env python

import matplotlib
import matplotlib.pyplot as plt

counts = [1, 8, 71]
diffs = range(len(counts))
plt.plot(diffs, counts)
plt.axes([0, 200, 0, 100])
plt.show()

Here is one of the tracebacks:

Exception in Tkinter callback
Traceback (most recent call last):
   File "/usr/lib/python2.6/lib-tk/Tkinter.py", line 1413, in __call__
 return self.func(*args)
   File 
"/usr/lib/pymodules/python2.6/matplotlib/backends/backend_tkagg.py", 
line 246, in motion_notify_event
 FigureCanvasBase.motion_notify_event(self, x, y, guiEvent=event)
   File "/usr/lib/pymodules/python2.6/matplotlib/backend_bases.py", line 
1244, in motion_notify_event
 guiEvent=guiEvent)
   File "/usr/lib/pymodules/python2.6/matplotlib/backend_bases.py", line 
899, in __init__
 LocationEvent.__init__(self, name, canvas, x, y, guiEvent=guiEvent)
   File "/usr/lib/pymodules/python2.6/matplotlib/backend_bases.py", line 
813, in __init__
 axes_list = [a for a in self.canvas.figure.get_axes() if 
a.in_axes(self)]
   File "/usr/lib/pymodules/python2.6/matplotlib/axes.py", line 1538, in 
in_axes
 return self.patch.contains(mouseevent)[0]
   File "/usr/lib/pymodules/python2.6/matplotlib/patches.py", line 502, 
in contains
 x, y = self.get_transform().inverted().transform_point(
   File "/usr/lib/pymodules/python2.6/matplotlib/transforms.py", line 
1430, in inverted
 self._inverted = Affine2D(inv(mtx))
   File "/usr/lib/pymodules/python2.6/numpy/linalg/linalg.py", line 423, 
in inv
 return wrap(solve(a, identity(a.shape[0], dtype=a.dtype)))
   File "/usr/lib/pymodules/python2.6/numpy/linalg/linalg.py", line 306, 
in solve
 raise LinAlgError, 'Singular matrix'
LinAlgError: Singular matrix

A Google search on "matplotlib mouseevent singular matrix" found that
a similar problem was discussed in matplotlib-users on Jul 29, 2008:
"bar plot picker with 0 height data". John Hunter committed a fix:
"svn r5922".  The program that caused the bug in 2008 works on my system.


--
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Facecolor not changing for web service?

2012-02-20 Thread Jeffrey Melloy
It works perfectly.  I thought I had tried that. :/

On Mon, Feb 20, 2012 at 4:18 PM, Eric Firing  wrote:
> On 02/20/2012 01:36 PM, Jeffrey Melloy wrote:
>> I'm using Flask to output graphs to a web service, and when I move
>> from a standalone script to the web service I'm getting weird
>> behavior.
>>
>> In gantt_test.py, I do this:
>>
>> from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas
>> from matplotlib.figure import Figure
>> [...]
>>
>> canvas = FigureCanvas(fig)
>> fig.savefig("gantt.png")
>>
>>
>> And it looks nice.
>>
>> In the web service, the only difference is:
>>
>>      canvas = FigureCanvas(fig)
>>
>>      x = StringIO()
>>
>>      canvas.print_png(x, facecolor="w", edgecolor="w", dpi=100)
>
> What happens if instead of using canvas.print_png you use
> fig.savefig(x, format="png")
>
> Eric
>
>>
>> And it has a grey background, weirder margins, and seems to be stuck at 
>> dpi=80.
>>
>> What am I missing? The version of python&  matplotlib are the same
>> between machines.  One is Windows 7, the other 2K3.
>>
>> -Jeff
>>
>>
>>
>> --
>> Try before you buy = See our experts in action!
>> The most comprehensive online learning library for Microsoft developers
>> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
>> Metro Style Apps, more. Free future releases when you subscribe now!
>> http://p.sf.net/sfu/learndevnow-dev2
>>
>>
>>
>> ___
>> Matplotlib-users mailing list
>> Matplotlib-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
> --
> Keep Your Developer Skills Current with LearnDevNow!
> The most comprehensive online learning library for Microsoft developers
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-d2d
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Facecolor not changing for web service?

2012-02-20 Thread Eric Firing
On 02/20/2012 01:36 PM, Jeffrey Melloy wrote:
> I'm using Flask to output graphs to a web service, and when I move
> from a standalone script to the web service I'm getting weird
> behavior.
>
> In gantt_test.py, I do this:
>
> from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas
> from matplotlib.figure import Figure
> [...]
>
> canvas = FigureCanvas(fig)
> fig.savefig("gantt.png")
>
>
> And it looks nice.
>
> In the web service, the only difference is:
>
>  canvas = FigureCanvas(fig)
>
>  x = StringIO()
>
>  canvas.print_png(x, facecolor="w", edgecolor="w", dpi=100)

What happens if instead of using canvas.print_png you use
fig.savefig(x, format="png")

Eric

>
> And it has a grey background, weirder margins, and seems to be stuck at 
> dpi=80.
>
> What am I missing? The version of python&  matplotlib are the same
> between machines.  One is Windows 7, the other 2K3.
>
> -Jeff
>
>
>
> --
> Try before you buy = See our experts in action!
> The most comprehensive online learning library for Microsoft developers
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-dev2
>
>
>
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Animation module

2012-02-20 Thread Allen Hathaway
Worked like a charm.  Thanks.

 

Allen

 

From: ben.v.r...@gmail.com [mailto:ben.v.r...@gmail.com] On Behalf Of
Benjamin Root
Sent: Monday, February 20, 2012 3:21 PM
To: Allen Hathaway
Cc: matplotlib-users@lists.sourceforge.net
Subject: Re: [Matplotlib-users] Animation module

 

 

On Mon, Feb 20, 2012 at 12:32 PM, Allen Hathaway
 wrote:

I downloaded the Windows installer and installed matplotlib.  I tried to
run one of the examples from the examples directory - animate_decay -
and got the following error:

 

Traceback (most recent call last):

  File "C:\Bin\Python Scripts\plot_decay.py", line 3, in 

import matplotlib.animation as animation

ImportError: No module named animation

 

What did I do wrong?

 

Allen

 


Chances are, an older version of matplotlib is still installed.  Clean
out all matplotlib installs and reinstall the current one.  (Note: need
v1.1.0 and greater for the animation module).

Also, please keep in mind the animation module is very much an
experiment and we greatly welcome feedback on how it works for you!

Cheers!
Ben Root

--
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Animation module

2012-02-20 Thread Benjamin Root
On Mon, Feb 20, 2012 at 12:32 PM, Allen Hathaway
wrote:

> I downloaded the Windows installer and installed matplotlib.  I tried to
> run one of the examples from the examples directory – animate_decay – and
> got the following error:
>
> ** **
>
> Traceback (most recent call last):
>
>   File "C:\Bin\Python Scripts\plot_decay.py", line 3, in 
>
> import matplotlib.animation as animation
>
> ImportError: No module named animation
>
> ** **
>
> What did I do wrong?
>
> ** **
>
> Allen
>
>
Chances are, an older version of matplotlib is still installed.  Clean out
all matplotlib installs and reinstall the current one.  (Note: need v1.1.0
and greater for the animation module).

Also, please keep in mind the animation module is very much an experiment
and we greatly welcome feedback on how it works for you!

Cheers!
Ben Root
--
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Animation module

2012-02-20 Thread Allen Hathaway
I downloaded the Windows installer and installed matplotlib.  I tried to
run one of the examples from the examples directory - animate_decay -
and got the following error:

 

Traceback (most recent call last):

  File "C:\Bin\Python Scripts\plot_decay.py", line 3, in 

import matplotlib.animation as animation

ImportError: No module named animation

 

What did I do wrong?

 

Allen

--
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users