Re: [Matplotlib-users] Change column number within legend

2013-08-05 Thread Tyrax
Hi Chao,

I think I could make it work somehow but I thought that such a functionality
would be really nice to have in general. 

Tyrax



--
View this message in context: 
http://matplotlib.1069221.n5.nabble.com/Change-column-number-within-legend-tp41704p41709.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

--
Get your SQL database under version control now!
Version control is standard for application code, but databases havent 
caught up. So what steps can you take to put your SQL databases under 
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Rendering SciPy docstrings as markup text within matplotlib

2013-08-05 Thread federico vaggi
Hi,

SciPy (and NumPy) docstrings are written with a special kind of mark up:

For example, the docstring for the russellrao distance function looks like
this:

'\nComputes the Russell-Rao dissimilarity between two boolean 1-D
arrays.\n\nThe Russell-Rao dissimilarity between two boolean 1-D
arrays, `u` and\n`v`, is defined as\n\n.. math::\n\n  \\frac{n
- c_{TT}}\n   {n}\n\nwhere :math:`c_{ij}` is the number of
occurrences of\n:math:`\\mathtt{u[k]} = i` and :math:`\\mathtt{v[k]} =
j` for\n:math:`k  n`.\n\nParameters\n--\nu : (N,)
array_like, bool\nInput array.\nv : (N,) array_like, bool\n
   Input array.\n\nReturns\n---\nrussellrao : double\n
   The Russell-Rao dissimilarity between vectors `u` and `v`.\n\n'

What's the most efficient way to turn this into a format where you can
format it nicely as a matplotlib text object?

I tried:

fig = plt.figure()

ax = fig.add_subplot(111)

props = dict(boxstyle='round', facecolor='wheat', alpha=0.5)

textstr = dist_fcn.__doc__

textstr = textstr.replace('math:',' ')

textstr = textstr.replace('`', '$')

textstr = textstr.replace('\n\n where', '$\n\n where')

ax.text(0.05, 0.95, textstr, transform=ax.transAxes, fontsize=14,

verticalalignment='top', bbox=props)


Which does an 'ok' job, at best, since fractions aren't converted properly.
 Is there a way to do it nicely short of using some horrendous regular
expressions?


Federico
--
Get your SQL database under version control now!
Version control is standard for application code, but databases havent 
caught up. So what steps can you take to put your SQL databases under 
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] ANN: matplotlib 1.3.0 released

2013-08-05 Thread Michael Droettboom

On 08/03/2013 07:50 AM, Rita wrote:
Same problem in Linux also. Here is what I did to fix it: Remove the 
freetype/fontconfig rpm from my local install (yum remove) and then 
place the proper PKG_CONFIG_PATH to point to my remote 
freetype/fontconfig.


By remote, you mean self-built, rather than from a package?

The problem is there is a bug with setupext.py. We ought to prepend 
PKG_CONFIG_PATH in the gcc compile statement.  I hope this helps.


Can you elaborate?  The setupext.py just calls whatever pkg-config is 
first on the PATH, which should then in turn obey PKG_CONFIG_PATH.  If 
the user needs a custom PKG_CONFIG_PATH, it is generally the 
resposibility of the user to set it correctly -- and matplotlib's build 
system should (and does) use it.  Or maybe I'm just misunderstanding 
what you're suggesting.


Cheers,
Mike







On Fri, Aug 2, 2013 at 6:53 AM, Andrew Jaffe a.h.ja...@gmail.com 
mailto:a.h.ja...@gmail.com wrote:


Hi,


On 01/08/2013 19:06, Michael Droettboom wrote:
 On behalf of a veritable army of super coders, I'm pleased to
announce
 the release of matplotlib 1.3.0.

Two issues on OSX 10.8.4. I had been previously using the dmg
installer.
Lacking that, I tried easy-install and pip install, both of which gave
me the following problems:

  - I needed to set CC=clang
  - When attempting to load matplotlib, I got the following error:


/Volumes/Data/Users/jaffe/Library/Python/2.7/lib/python/site-packages/matplotlib/font_manager.py
in module()
  51 import matplotlib
  52 from matplotlib import afm
--- 53 from matplotlib import ft2font
  54 from matplotlib import rcParams, get_cachedir
  55 from matplotlib.cbook import is_string_like

ImportError:

dlopen(/Volumes/Data/Users/jaffe/Library/Python/2.7/lib/python/site-packages/matplotlib/ft2font.so,
2): Symbol not found: _FT_Attach_File
   Referenced from:

/Volumes/Data/Users/jaffe/Library/Python/2.7/lib/python/site-packages/matplotlib/ft2font.so
   Expected in: flat namespace
  in

/Volumes/Data/Users/jaffe/Library/Python/2.7/lib/python/site-packages/matplotlib/ft2font.so


This is a freetype problem, probably an incompatible version
somewhere.
Ideas?

Andrew




--
Get your SQL database under version control now!
Version control is standard for application code, but databases havent
caught up. So what steps can you take to put your SQL databases under
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
mailto:Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users




--
--- Get your facts first, then you can distort them as you please.--


--
Get your SQL database under version control now!
Version control is standard for application code, but databases havent
caught up. So what steps can you take to put your SQL databases under
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711iu=/4140/ostg.clktrk


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


--
Get your SQL database under version control now!
Version control is standard for application code, but databases havent 
caught up. So what steps can you take to put your SQL databases under 
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Rendering SciPy docstrings as markup text within matplotlib

2013-08-05 Thread Michael Droettboom
docutils is the library that supports the format (restructuredtext) that 
these docstrings are written in.  It *may* (I haven't looked) contain 
functionality to render as clean plain text.


Mike

On 08/05/2013 09:57 AM, federico vaggi wrote:

Hi,

SciPy (and NumPy) docstrings are written with a special kind of mark up:

For example, the docstring for the russellrao distance function looks 
like this:


'\nComputes the Russell-Rao dissimilarity between two boolean 1-D 
arrays.\n\nThe Russell-Rao dissimilarity between two boolean 1-D 
arrays, `u` and\n`v`, is defined as\n\n.. math::\n\n 
 \\frac{n - c_{TT}}\n {n}\n\nwhere :math:`c_{ij}` is the number of 
occurrences of\n:math:`\\mathtt{u[k]} = i` and 
:math:`\\mathtt{v[k]} = j` for\n:math:`k  n`.\n\nParameters\n 
 --\nu : (N,) array_like, bool\nInput array.\n   
 v : (N,) array_like, bool\nInput array.\n\nReturns\n   
 ---\nrussellrao : double\nThe Russell-Rao 
dissimilarity between vectors `u` and `v`.\n\n'


What's the most efficient way to turn this into a format where you can 
format it nicely as a matplotlib text object?


I tried:

fig = plt.figure()

ax = fig.add_subplot(111)

props = dict(boxstyle='round', facecolor='wheat', alpha=0.5)

textstr = dist_fcn.__doc__

textstr = textstr.replace('math:',' ')

textstr = textstr.replace('`', '$')

textstr = textstr.replace('\n\n where', '$\n\n where')

ax.text(0.05, 0.95, textstr, transform=ax.transAxes, fontsize=14,

verticalalignment='top', bbox=props)


Which does an 'ok' job, at best, since fractions aren't converted 
properly.  Is there a way to do it nicely short of using some 
horrendous regular expressions?



Federico



--
Get your SQL database under version control now!
Version control is standard for application code, but databases havent
caught up. So what steps can you take to put your SQL databases under
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711iu=/4140/ostg.clktrk


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


--
Get your SQL database under version control now!
Version control is standard for application code, but databases havent 
caught up. So what steps can you take to put your SQL databases under 
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Bug in Custom Dash List

2013-08-05 Thread Benjamin Root
@mdboom, from git blame, this looks to be specifically introduced by you
via 
7e7b5320https://github.com/matplotlib/matplotlib/commit/7e7b532057c08541489203697987a924e56a7aebon
May 15th, and you even added some tests for handling path clipping.
Perhaps the choice of = should have been just ?
--
Get your SQL database under version control now!
Version control is standard for application code, but databases havent 
caught up. So what steps can you take to put your SQL databases under 
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Bug in Custom Dash List

2013-08-05 Thread Michael Droettboom
The problem is that a 0-length dash or space is undefined.  In Agg, it 
causes an infinite loop (presumably because the line cursor never 
moves).  Saving it to a PDF file and opening it in Acrobat Reader 
reveals a blank page (presumably because it's doing something smarter, 
but also basically throwing up its hands).  In SVG, you get a solid 
line, which may or may not be the right behavior.


Given that a value of 0 doesn't make much sense anyway, I thought it 
best to just disallow it.  Jeffrey: Do you have a good need for this?


Here's the original PR:

https://github.com/matplotlib/matplotlib/pull/1999

Mike

On 08/05/2013 01:36 PM, Benjamin Root wrote:
@mdboom, from git blame, this looks to be specifically introduced by 
you via |7e7b5320 
https://github.com/matplotlib/matplotlib/commit/7e7b532057c08541489203697987a924e56a7aeb 
on May 15th, and you even added some tests for handling path 
clipping.  Perhaps the choice of = should have been just ?|



--
Get your SQL database under version control now!
Version control is standard for application code, but databases havent
caught up. So what steps can you take to put your SQL databases under
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711iu=/4140/ostg.clktrk


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


--
Get your SQL database under version control now!
Version control is standard for application code, but databases havent 
caught up. So what steps can you take to put your SQL databases under 
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Failed pip install on OSX

2013-08-05 Thread Matthew Brett
Hi,

On Sun, Aug 4, 2013 at 7:26 PM, Scott Lasley slas...@space.umd.edu wrote:

 On Aug 4, 2013, at 4:47 PM, Matthew Brett matthew.br...@berkeley.edu wrote:

 Hi,

 Congratulations on the new release.

 I just tried installing in a fresh installation of Python 2.7 from Python.org

 Am I right in thinking the recommended method is:

pip install matplotlib

 ?  I did this, and then:

 import matplotlib.pyplot as plt
 Traceback (most recent call last):
  File stdin, line 1, in module
  File 
 /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/pyplot.py,
 line 24, in module
import matplotlib.colorbar
  File 
 /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/colorbar.py,
 line 29, in module
import matplotlib.collections as collections
  File 
 /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/collections.py,
 line 23, in module
import matplotlib.backend_bases as backend_bases
  File 
 /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/backend_bases.py,
 line 50, in module
import matplotlib.textpath as textpath
  File 
 /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/textpath.py,
 line 14, in module
from matplotlib.mathtext import MathTextParser
  File 
 /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/mathtext.py,
 line 62, in module
import matplotlib._png as _png
 ImportError: 
 dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/_png.so,
 2): Library not loaded: /usr/X11/lib/libpng12.0.dylib
  Referenced from:
 /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/_png.so
  Reason: Incompatible library version: _png.so requires version
 42.0.0 or later, but libpng12.0.dylib provides version 36.0.0

 There were no previous versions of matplotlib installed.  This on OSX 10.6:

 Python 2.7.5  just installed from python.org
 X11 installed from the Apple installation disks for 10.6 before `pip
 install matplotlib`
 No homebrew etc

 Any hints about how I should debug this further?

 Thanks a lot for any help,

 Matthew

 I was able to install numpy 1.7.1 and matplotlib 1.30 under OS X 10.6.8 with 
 X11 version XQuartz 2.3.6 (xorg-server 1.4.2-apple56) and python 2.7.5 64-bit 
 from python.org using pip 1.4.

 Have you tried running Software Update?  If you installed X11 after updating 
 to 10.6.8 you can run the combo updater ( http://support.apple.com/kb/DL1399 
 ) to get the latest X11.   Alternately, you could try installing XQuartz from 
 http://xquartz.macosforge.org/landing/

Yes, the system was up to date before I installed matplotlib.   Just
to check my failing memory, I checked for updates (none), reinstalled
and got the same answer.

The combo updater looks like it's a fast track to the same outcome as
Software update - is it something different?

If Matplotlib is only expected to work for the Quartz installs - is it
worth trying to detect that and warn / error at install time?

Cheers,

Matthew

--
Get your SQL database under version control now!
Version control is standard for application code, but databases havent 
caught up. So what steps can you take to put your SQL databases under 
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Failed pip install on OSX

2013-08-05 Thread Eric Firing
On 2013/08/05 10:43 AM, Matthew Brett wrote:
 If Matplotlib is only expected to work for the Quartz installs - is it
 worth trying to detect that and warn / error at install time?

Logically, XQuartz should not be needed at all; mpl on the mac does not 
require X11.  It looks like XQuartz is an accidental dependency, as a 
way to get access to a suitable libpng.

A link from the libpng web site led to this:
http://ethan.tira-thompson.com/Mac_OS_X_Ports.html
which might be a viable alternative.

Eric

--
Get your SQL database under version control now!
Version control is standard for application code, but databases havent 
caught up. So what steps can you take to put your SQL databases under 
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Failed pip install on OSX

2013-08-05 Thread Scott Lasley

On Aug 5, 2013, at 4:43 PM, Matthew Brett matthew.br...@berkeley.edu wrote:

 Hi,
 
 On Sun, Aug 4, 2013 at 7:26 PM, Scott Lasley slas...@space.umd.edu wrote:
 
 On Aug 4, 2013, at 4:47 PM, Matthew Brett matthew.br...@berkeley.edu wrote:
 
 Hi,
 
 Congratulations on the new release.
 
 I just tried installing in a fresh installation of Python 2.7 from 
 Python.org
 
 Am I right in thinking the recommended method is:
 
   pip install matplotlib
 
 ?  I did this, and then:
 
 import matplotlib.pyplot as plt
 Traceback (most recent call last):
 File stdin, line 1, in module
 File 
 /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/pyplot.py,
 line 24, in module
   import matplotlib.colorbar
 File 
 /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/colorbar.py,
 line 29, in module
   import matplotlib.collections as collections
 File 
 /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/collections.py,
 line 23, in module
   import matplotlib.backend_bases as backend_bases
 File 
 /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/backend_bases.py,
 line 50, in module
   import matplotlib.textpath as textpath
 File 
 /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/textpath.py,
 line 14, in module
   from matplotlib.mathtext import MathTextParser
 File 
 /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/mathtext.py,
 line 62, in module
   import matplotlib._png as _png
 ImportError: 
 dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/_png.so,
 2): Library not loaded: /usr/X11/lib/libpng12.0.dylib
 Referenced from:
 /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/_png.so
 Reason: Incompatible library version: _png.so requires version
 42.0.0 or later, but libpng12.0.dylib provides version 36.0.0
 
 There were no previous versions of matplotlib installed.  This on OSX 10.6:
 
 Python 2.7.5  just installed from python.org
 X11 installed from the Apple installation disks for 10.6 before `pip
 install matplotlib`
 No homebrew etc
 
 Any hints about how I should debug this further?
 
 Thanks a lot for any help,
 
 Matthew
 
 I was able to install numpy 1.7.1 and matplotlib 1.30 under OS X 10.6.8 with 
 X11 version XQuartz 2.3.6 (xorg-server 1.4.2-apple56) and python 2.7.5 
 64-bit from python.org using pip 1.4.
 
 Have you tried running Software Update?  If you installed X11 after updating 
 to 10.6.8 you can run the combo updater ( http://support.apple.com/kb/DL1399 
 ) to get the latest X11.   Alternately, you could try installing XQuartz 
 from http://xquartz.macosforge.org/landing/
 
 Yes, the system was up to date before I installed matplotlib.   Just
 to check my failing memory, I checked for updates (none), reinstalled
 and got the same answer.
 
 The combo updater looks like it's a fast track to the same outcome as
 Software update - is it something different?

I don't remember if Software Update detects updates to X11.  What version of 
X11 are you running?  The version on the Snow Leopard install disks, 2.3.4, is 
older than version 2.3.6 installed by the combo updater.  As far as I know 
there is no standalone X11 2.3.6 updater for Snow Leopard.  You'll have to 
re-install the security updates that came out after the combo updater was 
released if you use it, which is a bit of a pain.  According to otool -L, the 
libpng12.0.dylib installed with X11 2.3.6 is version 45, compatibility version 
45, so it should work with matplotlib.

If you don't want to run the combo updater because of possible side effects or 
install XQuartz you can download libpng from 
http://sourceforge.net/projects/libpng/files/libpng15/1.5.17/, unpack it and do 
the standard ./configure, make, sudo make install to install it in 
/usr/local/lib.  setup.py should find it there.

hth,
Scott

 If Matplotlib is only expected to work for the Quartz installs - is it
 worth trying to detect that and warn / error at install time?
 
 Cheers,
 
 Matthew


--
Get your SQL database under version control now!
Version control is standard for application code, but databases havent 
caught up. So what steps can you take to put your SQL databases under 
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=48897031iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users