Re: [Matplotlib-users] colorbar and logscale

2010-06-24 Thread Benjamin Root
Benoit,

Is there any particular reason why you can't do a log10() of the data that
is being pcolor()'d and then label the colorbar as having units of dB?  That
would seem to be the most straight-forward approach to me.

Ben Root


2010/6/24 Benoit Donnet 

> Hi guys,
>
> I'm struggling with colorbar since this morning.  I'd like the colorbar
> being logscale
>
> I'm experimenting some strange behavior with the colorbar as some 'labels'
> appear several times.  For instance, 10^0 appears three times, 10^1 appears
> also three times, and so on.  I believe the exponent is the digit of the
> float, while I'd like to see the exponent (of the scientific notation)
>
> I attach a png of the plot
>
> Here is my code:
>
> k,m,fp = np.loadtxt(file, unpack=True)
> ki = linspace(k.min(), k.max(), 37)
> mi = linspace(m.min(), m.max(), 37)
> Z = griddata(k, m, fp, ki, mi)
> Z.shape
> K, M = meshgrid(ki, mi)
>
> pcolor(K, M, log10(Z))#, cmap=cm.gray)
> cbar = colorbar(format=FormatStrFormatter('$10^{%d}$'))
>
> semilogy()
> axis([1,20,1,50], font2)
> xlabel(r'\textrm{\# hash functions ($k$)}', font)
> ylabel(r'\textrm{vector size ($m$)}', font)
> cbar.ax.set_ylabel(r'$f_p$', font)
>
> I obviously suspect my code is flawed somewhere but I can't figure out
> where.  i have tested several format for the colorbar, like
> LogFormatterMathText, but it does not solve my problem.
>
> I would appreciate any kind of help.  Thanks in advance
>
> Keep on Rockin'
>
> Benoit
>
>
>
>
> ---
> Dr. Benoit Donnet
> Université catholique de Louvain (UCL)
> Ecole Polytechnique de Louvain (EPL) - Département d'Ingénierie
> Informatique (INGI)
> Place Sainte Barbe, 2
> B-1348 Louvain-la-Neuve
> Phone: +32 10 47 87 18
> Fax: +32 10 45 03 45
>
>
>
>
>
>
>
> --
> 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] colorbar and logscale

2010-06-24 Thread Benoit Donnet
Hello Benjamin,

Thanks for your reply.

> Is there any particular reason why you can't do a log10() of the data that is 
> being pcolor()'d and then label the colorbar as having units of dB?  That 
> would seem to be the most straight-forward approach to me.

That's what I first tested.

In that case, labels on the colorbar are the following (i don't attach the plot 
to avoid spamming the entire mailing-list): 0.0, -0.4, -0.8, -1.2, -1.6, ..., 
-3.6).  It does not mean anything :s

Benoit 

> 
> Ben Root
> 
> 
> 2010/6/24 Benoit Donnet 
> Hi guys,
> 
> I'm struggling with colorbar since this morning.  I'd like the colorbar being 
> logscale
> 
> I'm experimenting some strange behavior with the colorbar as some 'labels' 
> appear several times.  For instance, 10^0 appears three times, 10^1 appears 
> also three times, and so on.  I believe the exponent is the digit of the 
> float, while I'd like to see the exponent (of the scientific notation)
> 
> I attach a png of the plot
> 
> Here is my code:
> 
> k,m,fp = np.loadtxt(file, unpack=True)
> ki = linspace(k.min(), k.max(), 37)
> mi = linspace(m.min(), m.max(), 37)
> Z = griddata(k, m, fp, ki, mi)
> Z.shape
> K, M = meshgrid(ki, mi)
> 
> pcolor(K, M, log10(Z))#, cmap=cm.gray)
> cbar = colorbar(format=FormatStrFormatter('$10^{%d}$'))
> 
> semilogy()
> axis([1,20,1,50], font2)
> xlabel(r'\textrm{\# hash functions ($k$)}', font)
> ylabel(r'\textrm{vector size ($m$)}', font)
> cbar.ax.set_ylabel(r'$f_p$', font)
> 
> I obviously suspect my code is flawed somewhere but I can't figure out where. 
>  i have tested several format for the colorbar, like LogFormatterMathText, 
> but it does not solve my problem.
> 
> I would appreciate any kind of help.  Thanks in advance
> 
> Keep on Rockin'
> 
> Benoit
> 
> 
> 
> 
> ---
> Dr. Benoit Donnet
> Université catholique de Louvain (UCL)
> Ecole Polytechnique de Louvain (EPL) - Département d'Ingénierie Informatique 
> (INGI)
> Place Sainte Barbe, 2
> B-1348 Louvain-la-Neuve
> Phone: +32 10 47 87 18
> Fax: +32 10 45 03 45
> 
> 
> 
> 
> 
> 
> --
> 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
> 
> 

---
Dr. Benoit Donnet
Université catholique de Louvain (UCL)
Ecole Polytechnique de Louvain (EPL) - Département d'Ingénierie Informatique 
(INGI)
Place Sainte Barbe, 2
B-1348 Louvain-la-Neuve
Phone: +32 10 47 87 18
Fax: +32 10 45 03 45





--
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] colorbar and logscale

2010-06-24 Thread Benjamin Root
Ah, I just noticed that.

Actually, I think I just figured out what is happening.  The colorbar
automatically chooses what values to display, and in your case, the values
are 0.0, -0.4, -0.8, -1.2, -1.6, ..., -3.6, which when turned into integers
are 0, 0, 0, -1, -1, ..., -3, which matches what your first plot had.  All
we have to do is specify the values that the colorbar should list.  I am not
very familiar with this aspect, but it has something to do with specifying
your colormap and/or the normalizer.

Does anybody know of a good tutorial on creating colormaps and normalizers?

Ben Root


On Thu, Jun 24, 2010 at 8:53 AM, Benoit Donnet
wrote:

> Hello Benjamin,
>
> Thanks for your reply.
>
> Is there any particular reason why you can't do a log10() of the data that
> is being pcolor()'d and then label the colorbar as having units of dB?  That
> would seem to be the most straight-forward approach to me.
>
>
> That's what I first tested.
>
> In that case, labels on the colorbar are the following (i don't attach the
> plot to avoid spamming the entire mailing-list): 0.0, -0.4, -0.8, -1.2,
> -1.6, ..., -3.6).  It does not mean anything :s
>
> Benoit
>
>
> Ben Root
>
>
> 2010/6/24 Benoit Donnet 
>
>> Hi guys,
>>
>> I'm struggling with colorbar since this morning.  I'd like the colorbar
>> being logscale
>>
>> I'm experimenting some strange behavior with the colorbar as some 'labels'
>> appear several times.  For instance, 10^0 appears three times, 10^1 appears
>> also three times, and so on.  I believe the exponent is the digit of the
>> float, while I'd like to see the exponent (of the scientific notation)
>>
>> I attach a png of the plot
>>
>> Here is my code:
>>
>> k,m,fp = np.loadtxt(file, unpack=True)
>> ki = linspace(k.min(), k.max(), 37)
>> mi = linspace(m.min(), m.max(), 37)
>> Z = griddata(k, m, fp, ki, mi)
>> Z.shape
>> K, M = meshgrid(ki, mi)
>>
>> pcolor(K, M, log10(Z))#, cmap=cm.gray)
>> cbar = colorbar(format=FormatStrFormatter('$10^{%d}$'))
>>
>> semilogy()
>> axis([1,20,1,50], font2)
>> xlabel(r'\textrm{\# hash functions ($k$)}', font)
>> ylabel(r'\textrm{vector size ($m$)}', font)
>> cbar.ax.set_ylabel(r'$f_p$', font)
>>
>> I obviously suspect my code is flawed somewhere but I can't figure out
>> where.  i have tested several format for the colorbar, like
>> LogFormatterMathText, but it does not solve my problem.
>>
>> I would appreciate any kind of help.  Thanks in advance
>>
>> Keep on Rockin'
>>
>> Benoit
>>
>>
>>
>>
>> ---
>> Dr. Benoit Donnet
>> Université catholique de Louvain (UCL)
>> Ecole Polytechnique de Louvain (EPL) - Département d'Ingénierie
>> Informatique (INGI)
>> Place Sainte Barbe, 2
>> B-1348 Louvain-la-Neuve
>> Phone: +32 10 47 87 18
>> Fax: +32 10 45 03 45
>>
>>
>>
>>
>>
>>
>>
>> --
>> 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
>>
>>
>
>  ---
> Dr. Benoit Donnet
> Université catholique de Louvain (UCL)
> Ecole Polytechnique de Louvain (EPL) - Département d'Ingénierie
> Informatique (INGI)
> Place Sainte Barbe, 2
> B-1348 Louvain-la-Neuve
> Phone: +32 10 47 87 18
> Fax: +32 10 45 03 45
>
>
>
>
>
>
--
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] Animation crashes on Windows

2010-06-24 Thread João Luís Silva

Hi,

This simple script will animate correctly on Linux, but will not work on 
 Windows (mpl 0.99.3) and at the end will crash with a message box 
(unknown software exception (0x4015) at the location 0x1e05b62a) and 
prints to the console:


Fatal Python error: PyEval_RestoreThread: NULL tstate

This application has requested the Runtime to terminate it in an unusual 
way.

Please contact the application's support team for more information.

Please check this. Thank you,
João Luís Silva

(script inline and attached)

#---
import matplotlib.pyplot as plt
import numpy as np
plt.ion()

x = np.arange(0,2*np.pi,0.01)# x-array
data = np.array(np.sin(x))
line, = plt.plot(x,data)

for i in range(1,50):
data[:] = np.sin(x+i/10.0)
line.set_ydata(data)
plt.draw()# redraw the canvas
#---
import matplotlib.pyplot as plt
import numpy as np
plt.ion()

x = np.arange(0,2*np.pi,0.01)# x-array
data = np.array(np.sin(x))
line, = plt.plot(x,data)

for i in range(1,50):
data[:] = np.sin(x+i/10.0)
line.set_ydata(data)
plt.draw()# redraw the canvas

--
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] Animation crashes on Windows

2010-06-24 Thread João Luís Silva
The crash happens with the TKAgg backend but not with the GTKAgg 
backend, but the script will still not animate. This one will however:

#---
import matplotlib
matplotlib.use("GTKAgg")
import matplotlib.pyplot as plt
import numpy as np
plt.ion()

x = np.arange(0,2*np.pi,0.01)# x-array
data = np.array(np.sin(x))
line, = plt.plot(x,data)

for i in range(1,50):
 data[:] = np.sin(x+i/10.0)
 line.set_ydata(data+i-i)
 plt.draw()

plt.ioff()
#---

Note the +i-i on the set_ydata. For some reason set_ydata won't update 
on Windows if the array is the same, even if the data has changed.

João Luís Silva


--
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] Animation crashes on Windows

2010-06-24 Thread Christoph Gohlke


On 6/24/2010 9:49 AM, João Luís Silva wrote:
> Hi,
>
> This simple script will animate correctly on Linux, but will not work on
> Windows (mpl 0.99.3) and at the end will crash with a message box
> (unknown software exception (0x4015) at the location 0x1e05b62a) and
> prints to the console:
>
> Fatal Python error: PyEval_RestoreThread: NULL tstate
>
> This application has requested the Runtime to terminate it in an unusual
> way.
> Please contact the application's support team for more information.
>


I can not reproduce this bug with matplotlib 1.0dev on Windows. So this 
is apparently fixed in svn trunk, probably by 

 
which is related to 


Christoph

--
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] colorbar and logscale

2010-06-24 Thread Eric Firing
On 06/24/2010 04:03 AM, Benjamin Root wrote:
> Ah, I just noticed that.
>
> Actually, I think I just figured out what is happening.  The colorbar
> automatically chooses what values to display, and in your case, the
> values are 0.0, -0.4, -0.8, -1.2, -1.6, ..., -3.6, which when turned
> into integers are 0, 0, 0, -1, -1, ..., -3, which matches what your

Right, good eye!

> first plot had.  All we have to do is specify the values that the
> colorbar should list.  I am not very familiar with this aspect, but it
> has something to do with specifying your colormap and/or the normalizer.

The tick locations can be specified via the ticks kwarg to colorbar. 
 From the docstring:

 *ticks*   [ None | list of ticks | Locator object ]
   If None, ticks are determined automatically from the
   input.
 *format*  [ None | format string | Formatter object ]
   If None, the
   :class:`~matplotlib.ticker.ScalarFormatter` is used.
   If a format string is given, e.g. '%.3f', that is
   used. An alternative
   :class:`~matplotlib.ticker.Formatter` object may be
   given instead.

The OP may also wish to specify the range of the colormap via the vmin 
and vmax kwargs to pcolor (note that everything to do with the colormap 
and the norm is specified in pcolor, not in the call to colorbar.

The OP probably does not need to specify both the formatter and the 
ticker.  If it is certain that the range of values will be substantially 
geater than one, and integer tick values are desired, then try this:

int_ticker = MaxNLocator(nbins=6, integer=True)
cbar = colorbar(ticks=int_ticker)

nbins is the maximum number of intervals (one less than the max number 
of ticks).

The default formatter will print integers as integers, so no custom 
formatter is needed.  Specifying a custom format or formatter is risky 
because, as illustrated by your diagnosis of the OP's original problem, 
it can easily lead to labels that are not accurate representations of 
the tick values.


>
> Does anybody know of a good tutorial on creating colormaps and normalizers?

Custom norms are rare, and I don't think there is much in the way of 
documentation or examples.  The code in ticker.py is probably the best 
starting place for learning about customizing norms; it includes 
subclasses of Normalize. Colormaps are illustrated fairly well in the 
examples.  See the second example in 
http://matplotlib.sourceforge.net/examples/pylab_examples/contourf_demo.html 
for ListedColormap, see 
http://matplotlib.sourceforge.net/examples/pylab_examples/contourf_demo.html 
for examples of how to use the somewhat complicated 
LinearSegmentedColormap to generate a custom map, and 
http://matplotlib.sourceforge.net/examples/pylab_examples/show_colormaps.html 
for a view of built-in colormaps.

Eric

>
> Ben Root
>
>
> On Thu, Jun 24, 2010 at 8:53 AM, Benoit Donnet
> mailto:benoit.don...@uclouvain.be>> wrote:
>
> Hello Benjamin,
>
> Thanks for your reply.
>
>> Is there any particular reason why you can't do a log10() of the
>> data that is being pcolor()'d and then label the colorbar as
>> having units of dB?  That would seem to be the most
>> straight-forward approach to me.
>
> That's what I first tested.
>
> In that case, labels on the colorbar are the following (i don't
> attach the plot to avoid spamming the entire mailing-list): 0.0,
> -0.4, -0.8, -1.2, -1.6, ..., -3.6).  It does not mean anything :s
>
> Benoit
>
>>
>> Ben Root
>>
>>
>> 2010/6/24 Benoit Donnet > >
>>
>> Hi guys,
>>
>> I'm struggling with colorbar since this morning.  I'd like the
>> colorbar being logscale
>>
>> I'm experimenting some strange behavior with the colorbar as
>> some 'labels' appear several times.  For instance, 10^0
>> appears three times, 10^1 appears also three times, and so on.
>>  I believe the exponent is the digit of the float, while I'd
>> like to see the exponent (of the scientific notation)
>>
>> I attach a png of the plot
>>
>> Here is my code:
>>
>> k,m,fp = np.loadtxt(file, unpack=True)
>> ki = linspace(k.min(), k.max(), 37)
>> mi = linspace(m.min(), m.max(), 37)
>> Z = griddata(k, m, fp, ki, mi)
>> Z.shape
>> K, M = meshgrid(ki, mi)
>>
>> pcolor(K, M, log10(Z))#, cmap=cm.gray)
>> cbar = colorbar(format=FormatStrFormatter('$10^{%d}$'))
>>
>> semilogy()
>> axis([1,20,1,50], font2)
>> xlabel(r'\textrm{\# hash functions ($k$)}', font)
>> ylabel(r'\textrm{vector size ($m$)}', font)
>> cbar.ax.set_ylabel(r'$f_p$', font)
>>
>> I obviously suspect my code is flawed somewhere but I can't
>> figure out where.

[Matplotlib-users] most recent install instruction for Mac OS

2010-06-24 Thread Christopher Brewster
Can someone point me to up to date installation instructions for Mac OS 
(10.6.4, python 2.6.4)?

Every route I pursue hits a dead end.
- if I install from dmg files on the matplotlib, it is not visible to my python 
installation (I think it installs to the OSX native python).
- if I install via easy_install or pip, then I get an error (previously emailed 
about) saying that numpy is incorrectly installed (Numpy tests pass)
- if I try to follow the instructions on http://blog.hyperjeff.net/?p=160, I 
get errors such as:
---
tar: Unrecognized archive format: Inappropriate file type or format
tar: Error exit delayed from previous errors.
make: *** [zlib] Error 1
---

Ages ago I successfully installed on my laptop but I do not seem to be able to 
repeat the feat on my desktop.
Any help appreciated.

Christopher


--
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] Question about old matplotlib.transforms API

2010-06-24 Thread Florian Berger
Hi,

I've stumbled across an old application from 2007 which uses the old
matplotlib.transforms API, namely matplotlib.transforms.Value() which
obviously disappeared in a great transforms overhaul.

I tried to figure out what has become of these classes and functions
browsing the changelog and SVN, without success - there doesn't seem to
be a successor to these classes.

As I would love to tweak that particular application to make it
work again: could someone enlighten me what has become of
matplotlib.transforms.Value() and how to replace the functionality?

Thanks a ton!

Florian

--
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] Question about old matplotlib.transforms API

2010-06-24 Thread Michael Droettboom
There is a guide about porting from the old transforms to the new 
transforms here:

http://matplotlib.sourceforge.net/api/api_changes.html#notes-about-the-transforms-refactoring

Mike

On 06/24/2010 01:53 PM, Florian Berger wrote:
> Hi,
>
> I've stumbled across an old application from 2007 which uses the old
> matplotlib.transforms API, namely matplotlib.transforms.Value() which
> obviously disappeared in a great transforms overhaul.
>
> I tried to figure out what has become of these classes and functions
> browsing the changelog and SVN, without success - there doesn't seem to
> be a successor to these classes.
>
> As I would love to tweak that particular application to make it
> work again: could someone enlighten me what has become of
> matplotlib.transforms.Value() and how to replace the functionality?
>
> Thanks a ton!
>
> Florian
>
> --
> 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
>


-- 
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] Question about old matplotlib.transforms API

2010-06-24 Thread Ryan May
On Thu, Jun 24, 2010 at 1:11 PM, Michael Droettboom  wrote:
> There is a guide about porting from the old transforms to the new
> transforms here:
>
> http://matplotlib.sourceforge.net/api/api_changes.html#notes-about-the-transforms-refactoring

It's possible I'm missing something, but I don't see
matplotlib.transforms.Value() or anything remotely resembling it
mentioned there. I have no idea what the original method did, so I'm
not sure if this an omission or if I'm just dense.

Ryan

-- 
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma

--
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] Mac OS X 10.6 dmg install

2010-06-24 Thread Tim Gray
I'm updating my python install but am running into problems with matplotlib, 
as always.  This time around I'd thought I'd use the .dmg installer.  I've 
already installed Python 2.6.5 from python.org and numpy from scipy.org. 
Both of these work.  I noticed the matplotlib installer wants to install to 
/Library/Python/2.6/site-packages, even though the appropriate location for 
the python.org install is in 
/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages. 
As a result, when I run python 2.6.5 from python.org, it doesn't matplotlib.

Two questions: Is there a good reason for this?  And what's the workaround. 
Thanks.

Tim

--
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] Question about old matplotlib.transforms API

2010-06-24 Thread Florian Berger
Hi,

Ryan May :
>
> Michael Droettboom  wrote:
> > There is a guide about porting from the old transforms to the new
> > transforms here:
> >
> > http://matplotlib.sourceforge.net/api/api_changes.html#notes-about-the-transforms-refactoring
> 
> It's possible I'm missing something, but I don't see
> matplotlib.transforms.Value() or anything remotely resembling it
> mentioned there.

Same with me. :)  Michael, I've checked the very document and just like
Ryan I couldn't find any hint of what had become of that functionality.

Here is a diff of transforms.py before and after the refactoring:

http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/matplotlib/lib/matplotlib/transforms.py?r1=3513&r2=4817

On the left side you see that Value() has been featured quite
distinctively. After the refactoring there doesn't seem to be anything
left of it. To a newbie like me this is striking, as it seems to be a
major change in the API. I thus hoped it probably could have been moved
to another module or something like this.

Still glad about any enlightenments. :)

Best,
Florian

--
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] [ANN] Spyder v1.1.0 released

2010-06-24 Thread Pierre Raybaut
Hi all,

I'm pleased to announce here that Spyder version 1.1.0 has been released:
http://packages.python.org/spyder

Spyder (the Scientific PYthon Development EnviRonment) is a free open-source 
Python development environment providing MATLAB-like features in a simple and 
light-weighted software, available for Windows XP/Vista/7, GNU/Linux and MacOS 
X:
* advanced code editing features (code analysis, ...)
* interactive console with MATLAB-like workspace (with GUI-based
list, dictionary, tuple, text and array editors -- screenshots:
http://packages.python.org/spyder/console.html#the-workspace) and
integrated matplotlib figures
* external console to open an interpreter or run a script in a
separate process (with a global variable explorer providing the same
features as the interactive console's workspace)
* code analysis with pyflakes and pylint
* search in files features
* object inspector: automatically retrieves docstrings or
source code of the function/class called in the interactive/external
console
* online documentation viewer (pydoc)
* integrated file/directories explorer
* MATLAB-like path management
* project management
...and more!

Spyder is part of spyderlib, a Python module based on PyQt4 and
QScintilla2 which provides powerful console-related PyQt4 widgets.

Some of the major changes since v1.0.0 (433 commits!):
* A lot of bugfixes!
* IPython integration within the external console (still experimental)
* QScintilla2 is now optional (a whole pure PyQt4 code editor -faster than 
its QScintilla's counterpart- has been implemented): brings code folding and 
code completion
* Improved Matplotlib's figure options feature (added support for image 
parameters, added an "Apply" button)
* Added: Project Explorer plugin (Pydev projects may be imported)
* Added: Online help browser plugin (based on pydoc)
* Editor new features:
* Unlimited horizontal/vertical splitting: each new editor panel is a 
clone of the first panel, allowing comparing two parts of the same file
* Unlimited independent editor windows creation
* Flag vertical scrollbar area: shows warnings, TODOs, FIXMEs and 
occurrence highlighting of the whole file
* External console: added import/export features to the variable explorer

Cheers,
Pierre


--
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] Question about old matplotlib.transforms API

2010-06-24 Thread Eric Firing
On 06/24/2010 11:07 AM, Florian Berger wrote:
> Hi,
>
> Ryan May:
>>
>> Michael Droettboom  wrote:
>>> There is a guide about porting from the old transforms to the new
>>> transforms here:
>>>
>>> http://matplotlib.sourceforge.net/api/api_changes.html#notes-about-the-transforms-refactoring
>>
>> It's possible I'm missing something, but I don't see
>> matplotlib.transforms.Value() or anything remotely resembling it
>> mentioned there.
>
> Same with me. :)  Michael, I've checked the very document and just like
> Ryan I couldn't find any hint of what had become of that functionality.
>
> Here is a diff of transforms.py before and after the refactoring:
>
> http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/matplotlib/lib/matplotlib/transforms.py?r1=3513&r2=4817
>
> On the left side you see that Value() has been featured quite
> distinctively. After the refactoring there doesn't seem to be anything
> left of it. To a newbie like me this is striking, as it seems to be a
> major change in the API. I thus hoped it probably could have been moved
> to another module or something like this.

It was *such* a major change that Value and its ilk were completely 
replaced, not moved aside.  Value was a lazy value.  The original 
transforms system was based on lazy evaluation of expressions, for the 
sake of efficiency.  (The new transforms system achieves the same sort 
of efficiency but in a more general and extensible framework.)

To port code, you really have to look not for replacements for things 
like Value, but for how the structure changed so that they are not 
needed.  Essentially, you have to look at one level higher than the 
Value level--look at what you were trying to do with the code, not at 
how you implemented it via Value.  Unless you were using Value et al for 
your own purposes, rather than in Bbox etc, looking at this higher level 
should take you straight to the translations in the table that Mike made 
to help guide the transition.

Eric


>
> Still glad about any enlightenments. :)
>
> Best,
>   Florian
>
> --
> 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] Question about old matplotlib.transforms API

2010-06-24 Thread Florian Berger
Hi,

Eric Firing :
> 
> It was *such* a major change that Value and its ilk were completely 
> replaced, not moved aside.

Thanks, I feared as much. :)


> look at what you were trying to do with the code, not at how you
> implemented it via Value.

Well the thing is that *I* did not try anything, as it is third party
code. :)  So I fear I have to figure out why the original author found
Value() so appealing. *sigh*


> Unless you were using Value et al for your own purposes [...]

I think that is what he did. :-/

Anyway, thanks for the clarification!

Best,
Florian

--
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] Question about old matplotlib.transforms API

2010-06-24 Thread Eric Firing
On 06/24/2010 11:57 AM, Florian Berger wrote:
> Hi,
>
> Eric Firing:
>>
>> It was *such* a major change that Value and its ilk were completely
>> replaced, not moved aside.
>
> Thanks, I feared as much. :)
>
>
>> look at what you were trying to do with the code, not at how you
>> implemented it via Value.
>
> Well the thing is that *I* did not try anything, as it is third party
> code. :)  So I fear I have to figure out why the original author found
> Value() so appealing. *sigh*
>
>
>> Unless you were using Value et al for your own purposes [...]
>
> I think that is what he did. :-/

At least for those applications, you might be able to go back to an 
earlier mpl version, pull out the c++ code and the wrappers for Value, 
BinOp, etc., and turn them into an independent extension.  That might be 
worthwhile if you have a *lot* of third-party code that is using those 
things extensively in ways not tied to mpl.  I suspect it would not be 
very difficult.  It's a long time since I looked at that code, though.

Eric

>
> Anyway, thanks for the clarification!
>
> Best,
>  Florian
>

--
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] error: Gtk* backend requires pygtk to be installed

2010-06-24 Thread Stephen George

Hi  Mike,

I tried to run it on windows.

Got error
D:\download\python>demo_axes_grid.py
Traceback (most recent call last):
  File "D:\download\python\demo_axes_grid.py", line 2, in 
from demo_image import get_demo_image
ImportError: No module named demo_image

Went looking on examples page and found there was a file name demo_image.py
http://matplotlib.sourceforge.net/examples/axes_grid/demo_image.html

However for whatever reason the source code was not downloadable (404 
error), so I copied it off the html page.


After that the example ran fine under windows, ... I have never 
installed anything called 'dsextras' and don't know what it is.


However it doesn't look like a gtk GUI to me., a quick check of the code 
reveals no gtk type commands or imports?
I'd be questioning your configuration of matplotlib, there should be a 
rc file somewhere, maybe you (or your distro) have set the backend to 
gtk by default?
I don't have a system here without gtk installed, that I could test 
example runs without it installed - sorry.


(what distro and what's a pip command?)

- Steve


On 23/06/2010 11:09 PM, Mike Anderson wrote:

Hi,

I'm trying to run a demo example,
http://matplotlib.sourceforge.net/plot_directive/mpl_toolkits/axes_grid/figures/demo_axes_grid.py

ran into this problem saying pygtk was needed:

$ curl 
http://matplotlib.sourceforge.net/plot_directive/mpl_toolkits/axes_grid/figures/demo_axes_grid.py 
> demo_axes_grid.py


$  python demo_axes_grid.py
Traceback (most recent call last):
  File "demo_axes_grid.py", line 1, in 
import matplotlib.pyplot as plt
  File 
"/Library/Frameworks/Python.framework/Versions/Current/lib/python2.6/site-packages/matplotlib/pyplot.py", 
line 78, in 

new_figure_manager, draw_if_interactive, show = pylab_setup()
  File 
"/Library/Frameworks/Python.framework/Versions/Current/lib/python2.6/site-packages/matplotlib/backends/__init__.py", 
line 25, in pylab_setup

globals(),locals(),[backend_name])
  File 
"/Library/Frameworks/Python.framework/Versions/Current/lib/python2.6/site-packages/matplotlib/backends/backend_gtkagg.py", 
line 10, in 
from matplotlib.backends.backend_gtk import gtk, FigureManagerGTK, 
FigureCanvasGTK,\
  File 
"/Library/Frameworks/Python.framework/Versions/Current/lib/python2.6/site-packages/matplotlib/backends/backend_gtk.py", 
line 11, in 

raise ImportError("Gtk* backend requires pygtk to be installed.")
ImportError: Gtk* backend requires pygtk to be installed.



Then I tried to install pygtk:

$  pip install pygtk
Downloading/unpacking pygtk
  Running setup.py egg_info for package pygtk
Traceback (most recent call last):
  File "", line 14, in 
  File 
"/Users/michaelanderson/root/mikeWork/2010June/temp/build/pygtk/setup.py", 
line 22, in 

from dsextras import get_m4_define, getoutput, have_pkgconfig, \
ImportError: No module named dsextras
Complete output from command python setup.py egg_info:
Traceback (most recent call last):

  File "", line 14, in 

  File 
"/Users/michaelanderson/root/mikeWork/2010June/temp/build/pygtk/setup.py", 
line 22, in 


from dsextras import get_m4_define, getoutput, have_pkgconfig, \

ImportError: No module named dsextras


Command python setup.py egg_info failed with error code 1
Storing complete log in /Users/michaelanderson/.pip/pip.log


Ok, then I tried to install dsextras:
$  pip install dsextras
Downloading/unpacking dsextras
  Could not find any downloads that satisfy the requirement dsextras
No distributions at all found for dsextras
Storing complete log in /Users/michaelanderson/.pip/pip.log


What is this obscure package (dsextras) and is it really necessary to 
run the shared axes demo?


Mike


--
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] Mac OS X 10.6 dmg install (Tim Gray)

2010-06-24 Thread Adam J Richards
Hi Tim,

 From what I gather you are trying to install everything from source the 
trying to install via the dmg.  I did a fresh install of python, 
matplotlib and a number of other packages today (on 10.6) and maybe it 
would be helpful to see how to install from source.  When installing 
Python, be sure to use --enable-framework.  I used a /usr/local prefix 
though this may be somewhere else for you.

$ wget http://www.python.org/ftp/python/2.6.5/Python-2.6.5.tar.bz2
$ tar -jxvf Python-2.6.5.tar.bz2
$ cd Python-2.6.5
$ ./configure --prefix=/usr/local --enable-framework
$ make
$ make install

It appears that you have already installed numpy and so you would also 
need the following:

dateutils
$ sudo wget 
http://labix.org/download/python-dateutil/python-dateutil-1.5.tar.gz
$ sudo tar xzf python-dateutil-1.5.tar.gz
$ cd python-dateutil-1.5
$ sudo /usr/local/bin/python setup.py install

freetype
$ 
http://download.savannah.gnu.org/releases-noredirect/freetype/freetype-2.3.12.tar.gz
$ sudo tar xzf freetype-2.3.12.tar.gz
$ cd freetype-2.3.12
$ sudo ./configure --prefix=/usr/local
$ sudo make
$ sudo make install

libpng
$ sudo wget 
http://sourceforge.net/projects/libpng/files/01-libpng-master/1.4.2/libpng-1.4.2.tar.gz/download
$ sudo tar xzf libpng-1.4.2.tar.gz
$ cd libpng-1.4.2
$ sudo ./configure --prefix=/usr/local
$ sudo make
$ sudo make install

pkconfig
$ sudo wget http://pkgconfig.freedesktop.org/releases/pkg-config-0.22.tar.gz
$ sudo tar xzf pkg-config-0.22.tar.gz
$ cd pkg-config-0.22
$ sudo ./configure --prefix=/usr/local
$ sudo make
$ sudo make install

Finally, you should be able to install matplotlib from source using,
$ sudo wget 
http://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-0.99.3/matplotlib-0.99.3.tar.gz/download
$ sudo tar xzf matplotlib-0.99.3.tar.gz
$ cd matplotlib-0.99.3
$ sudo /usr/local/bin/python setup.py build
$ sudo /usr/local/bin/python setup.py install_*
*_
Hopefully this helps.

-Adam Richards

Duke University

--
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] Mac OS X 10.6 dmg install (Tim Gray)

2010-06-24 Thread Tim Gray
On Jun 24, 2010 at 08:58 PM -0400, Adam J Richards wrote:
> Hi Tim,
>
> From what I gather you are trying to install everything from source the
> trying to install via the dmg.  I did a fresh install of python,
> matplotlib and a number of other packages today (on 10.6) and maybe it
> would be helpful to see how to install from source.  When installing
> Python, be sure to use --enable-framework.  I used a /usr/local prefix
> though this may be somewhere else for you.

I'm actually trying to install from the prepackaged dmgs.  That would speed 
things up for me quite a bit.  All the other components went fine, but it 
looks like the matplotlib dmg is configured for the wrong location.  I saw a 
couple mentions of this in the archives but no responses...

I guess I'll try from source if no one has a different solution.  Your notes 
will help me if I have to do that.  Thanks!

--
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] Mac OS X 10.6 dmg install (Tim Gray)

2010-06-24 Thread Hana Sevcikova
Tim,

I think you just need to direct the PYTHONPATH variable to the place 
where matplotlib is installed. My PYTHONPATH looks like this:

/Library/Frameworks/Python.framework/Versions/Current/lib/python2.6/site-packages:/Library/Python/2.6/site-packages

Hana

On 6/24/10 6:45 PM, Tim Gray wrote:
> On Jun 24, 2010 at 08:58 PM -0400, Adam J Richards wrote:
>
>> Hi Tim,
>>
>>  From what I gather you are trying to install everything from source the
>> trying to install via the dmg.  I did a fresh install of python,
>> matplotlib and a number of other packages today (on 10.6) and maybe it
>> would be helpful to see how to install from source.  When installing
>> Python, be sure to use --enable-framework.  I used a /usr/local prefix
>> though this may be somewhere else for you.
>>  
> I'm actually trying to install from the prepackaged dmgs.  That would speed
> things up for me quite a bit.  All the other components went fine, but it
> looks like the matplotlib dmg is configured for the wrong location.  I saw a
> couple mentions of this in the archives but no responses...
>
> I guess I'll try from source if no one has a different solution.  Your notes
> will help me if I have to do that.  Thanks!
>
> --
> 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] error: Gtk* backend requires pygtk to be installed

2010-06-24 Thread Mike Anderson
Hi,

> Went looking on examples page and found there was a file name demo_image.py
> http://matplotlib.sourceforge.net/examples/axes_grid/demo_image.html
>
> However for whatever reason the source code was not downloadable (404
> error), so I copied it off the html page.

I'm not sure why the matplotlib examples page would contain weird
dependencies like that, rather than just having simpler examples.

As for 'pip', it is a replacement for 'easy_install', both of which
find and install python packages.  pip is meant to improve on
easy_install, with new features and more stability.


And I think you figured out my exact problem:

> I'd be questioning your configuration of matplotlib, there should be a rc
> file somewhere, maybe you (or your distro) have set the backend to gtk by
> default?

Yep, unfortunately in ~/.matplotlib/matplotlibrc
this line was set to
backend  : GTKAgg

So I fixed that.  The other solution I found is to have at the top of
the plotting script the matplotlib.use() statement so that it uses
something else for a backend:

import matplotlib   # Do this before importing pylab or pyplot
#matplotlib.use('Agg')   # Anti-Grain Geometry  (raster images)
matplotlib.use('PDF')
import matplotlib.pyplot as plt

Thanks!
Mike

--
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