[Matplotlib-users] Contour/Contourf misunderstanding?

2008-12-10 Thread Andrea Gavana
Hi All,

I am trying to create a contour map with matplotlib. I have
modified the source code for the contour sample which comes with the
matplotlib 0.98.3 online documentation: I am using the "contour(X, Y,
Z, V)" API call and, as the docs say:

"""
contour(X,Y,Z,V)
draw contour lines at the values specified in sequence V
"""

I have specified a 20-elements vector in V, buit I still only see 6
contours being drawn, namely the ones at the values:

[-1.0, -0.5, 0.0, 0.5, 1.0, 1.5]


I attach my small sample to the message. Am I doing something worng in
my call to contour? Why I am unable to see the 20 contour I specified
in my vector V?

Another related problem is with contourf: if I modify the attached
sample to use contourf and clabel, I get this error:

Traceback (most recent call last):
  File "E:\MyProjects\prova143.py", line 24, in 
plt.clabel(CS, fontsize=9, inline=1)
  File "C:\Python25\lib\site-packages\matplotlib\pyplot.py", line
1736, in clabel
ret =  gca().clabel(*args, **kwargs)
  File "C:\Python25\lib\site-packages\matplotlib\axes.py", line 6027, in clabel
return CS.clabel(*args, **kwargs)
  File "C:\Python25\lib\site-packages\matplotlib\contour.py", line
161, in clabel
self.labelCValueList = np.take(self.cvalues, self.labelIndiceList)
  File "C:\Python25\lib\site-packages\numpy\core\fromnumeric.py", line
85, in take
return take(indices, axis, out, mode)
IndexError: index out of range for array


This is in Windows XP, Python 2.5.2, matplotlib 0.98.3, numpy 1.2.0.

Thank you for your suggestions.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/


# CODE START

#!/usr/bin/env python

import matplotlib
import numpy as np
import matplotlib.mlab as mlab
import matplotlib.pyplot as plt

delta = 0.025
x = np.arange(-3.0, 3.0, delta)
y = np.arange(-2.0, 2.0, delta)
X, Y = np.meshgrid(x, y)
Z1 = mlab.bivariate_normal(X, Y, 1.0, 1.0, 0.0, 0.0)
Z2 = mlab.bivariate_normal(X, Y, 1.5, 0.5, 1, 1)
# difference of Gaussians
Z = 10.0 * (Z2 - Z1)

V = np.linspace(np.min(np.min(Z)), np.max(np.max(Z)), 20)

print V

# And you can manually specify the colors of the contour
plt.figure()
CS = plt.contourf(X, Y, Z, V=V)
plt.clabel(CS, fontsize=9, inline=1)

plt.show()

# CODE END

--
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Contour/Contourf misunderstanding?

2008-12-10 Thread Andrea Gavana
Hi Mauro & All,

On Wed, Dec 10, 2008 at 10:32 AM, Mauro Cavalcanti wrote:
> Dear Andrea,
>
> Greetings. I have tried your script here.
>
> 2008/12/10 Andrea Gavana <[EMAIL PROTECTED]>:
>> I attach my small sample to the message. Am I doing something worng in
>> my call to contour? Why I am unable to see the 20 contour I specified
>> in my vector V?
>
> But you can. Simply change the line below to:
>> CS = plt.contourf(X, Y, Z, V=V)
>
>> CS = plt.contourf(X, Y, Z, V)
> (I did not understand the reason behind the "V=V" in the argument list?)

Ah! I thought "V" was a keyword argument. Shame on me. Thank you for the hint.

>> Another related problem is with contourf: if I modify the attached
>> sample to use contourf and clabel, I get this error:
>
> Well, this one I do not understand myself.

Uhm, I will wait for further suggestions. Maybe I am doing something
stupid, again ;-)

Thank you!

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

--
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Any news on wxMPL ?

2008-12-10 Thread massimo sandal

Ken,

Thanks a lot for your answer. I am very happy to know that you are alive 
and (mostly) healthy and that you didn't forget us! :)


I'm sorry I didn't reply to your email.  It fell through the cracks, so 
to speak.


WxMpl development has been stalled for quite some time now because I 
developed bilateral carpal tunnel syndrome this past spring.  It was not 
my intention to leave it abandoned and incompatible with matplotlib, but 
I've been finding everything to be a bit of an uphill battle these days.


Woah, how bad. I'm sorry about that, I hope you're somehow recovering.

My current plan is to spend some time later this month bringing WxMpl up 
to date with the API changes.  I'd be very pleased to see it hosted as a 
matplotlib toolkit, so I'll move it over once it's working properly.  If 
someone wants to move the source over and start hacking on it in the 
interim, please be my guest.


Thanks a lot for your interest. I didn't have time to go into the wxmpl 
source, but another guy (Paulo Meira , [EMAIL PROTECTED] ) did a terrific 
work in bringing wxmpl up to date. I think you could start by contacting 
him.


I attach his patched wxmpl.py in this mail. What I can say is that it is 
mostly working, at least for basic plotting, but it has some funny bug 
here and there (i.e. one of my collegues found on his system that the 
axes direction flips when zooming). It could be an interesting startpoint.


Thanks a lot for your feedback again. I develop a data analysis 
application that uses wx and MPL and your little library made things 
much easier. Thanks for your wonderful work.


Massimo

--
Massimo Sandal , Ph.D.
University of Bologna
Department of Biochemistry "G.Moruzzi"

snail mail:
Via Irnerio 48, 40126 Bologna, Italy

email:
[EMAIL PROTECTED]

web:
http://www.biocfarm.unibo.it/samori/people/sandal.html

tel: +39-051-2094388
fax: +39-051-2094387


wxmpl.py.gz
Description: application/gzip
begin:vcard
fn:Massimo Sandal
n:Sandal;Massimo
org:University of Bologna;Department of Biochemistry
adr:;;Via Irnerio 48;Bologna;;40126;Italy
email;internet:[EMAIL PROTECTED]
tel;work:+39-051-2094388
tel;fax:+39-051-2094387
x-mozilla-html:FALSE
version:2.1
end:vcard

--
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] [SciPy-user] reading and writing data in Excel files

2008-12-10 Thread Nils Wagner
On Wed, 10 Dec 2008 04:24:24 -0800
  "Joshua Lippai" <[EMAIL PROTECTED]> wrote:
> With PyExcelerator installed, you can use the Excel 
>tools in the
> matplotlib toolkits
> 
> http://matplotlib.sourceforge.net/users/toolkits.html
> 
> Using them, you can read in Excel files as recarrays and 
>write
> recarrays to Excel files. It's fairly well-documented 
>through
> docstrings.
> 
> Josh
> 
Hi Josh,

Thank you for your prompt response !
  
I found an example in matplotlib/examples/pylab_examples
loadrec.py

Is it possible to color cells depending on the entry ?

Nils

  

--
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Fwd: [SciPy-user] reading and writing data inExcel files

2008-12-10 Thread Nils Wagner



  --- the forwarded message follows ---
--- Begin Message ---
>From the looks of the mail archive, it seems PyExcelerator is no longer 
>maintained 
http://sourceforge.net/mailarchive/forum.php?forum_name=pyexcelerator-devel

You are advised to rather use xlwt to write Excel:
http://pypi.python.org/pypi/xlwt
and xlrd to read Excel:
http://pypi.python.org/pypi/xlrd/

Both maintained by John Machin.

>>> On 2008/12/10 at 03:11, in message <[EMAIL PROTECTED]>, "Nils Wagner" 
>>> <[EMAIL PROTECTED]> wrote:
On Wed, 10 Dec 2008 04:24:24 -0800
  "Joshua Lippai" <[EMAIL PROTECTED]> wrote:
> With PyExcelerator installed, you can use the Excel 
>tools in the
> matplotlib toolkits
> 
> http://matplotlib.sourceforge.net/users/toolkits.html 
> 
> Using them, you can read in Excel files as recarrays and 
>write
> recarrays to Excel files. It's fairly well-documented 
>through
> docstrings.
> 
> Josh
> 
Hi Josh,

Thank you for your prompt response !
  
I found an example in matplotlib/examples/pylab_examples
loadrec.py

Is it possible to color cells depending on the entry ?

Nils

  

--
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/ 
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net 
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


-- 
This message is subject to the CSIR's copyright terms and conditions, e-mail 
legal notice, and implemented Open Document Format (ODF) standard. 
The full disclaimer details can be found at 
http://www.csir.co.za/disclaimer.html.

This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.  MailScanner thanks Transtec Computers for their 
support.

--- End Message ---
--
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] MPL linestyles and plot markers

2008-12-10 Thread Mauro Cavalcanti
Dear ALL,

Searching the MPL online documentation, I just found out that plot
linestyles can also be represented as a string (legal string values
are 'solid'|'dashed'|'dashdot'|'dotted'). So, I would like to ask you
gentlemen if such string representation is also available for plot
markers (I could not find this in the docs and so I am afraid it is
not) ?

Also, using linestyles in the conventional way (as single characters),
the docs are not very clear as what is what, so in linestyles = ['_',
'-', '--', ':'] is the underline character ('_') representing a solid
line? But in this case, what is the '-' character representing? An so
on... In my application, either "-",  "--" (dotted?) and "-." (dash
dotted?) show solid lines and only ":" (dotted) works as expected,
showing a dotted line.

I am aware that this might, perhaps, be answered by trial-and-error in
the interactive prompt, but in my opinion if one can find the needed
information in the docs, this saves a lot of time with these tests
that sometimes are too much.

Thanks in advance for any hints and tips.

Best regards,

-- 
Dr. Mauro J. Cavalcanti
Ecoinformatics Studio
P.O. Box 46521, CEP 20551-970
Rio de Janeiro, RJ, BRASIL
E-mail: [EMAIL PROTECTED]
Web: http://studio.infobio.net
Linux Registered User #473524 * Ubuntu User #22717
"Life is complex. It consists of real and imaginary parts."

--
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] ANN: matplotlib-0.98.4

2008-12-10 Thread John Hunter
We have just released a new version of matplotlib, available for download at


https://sourceforge.net/project/showfiles.php?group_id=80706&package_id=278194&release_id=646146

These "what's new" release notes, with graphs and links, are available in
html at

  http://matplotlib.sourceforge.net/users/whats_new.html

Thanks to Charlie Moad for testing and preparing the source release,
including binaries for OS X and Windows for python 2.4 and 2.5 (2.6
and 3.0 will not be available until numpy is available on those
releases).  Thanks to the many developers who contributed to this
release, with contributions from Jae-Joon Lee, Michael Droettboom,
Ryan May, Eric Firing, Manuel Metz, Jouni K. Seppaenen, Jeff Whitaker,
Darren Dale, David Kaplan, Michiel de Hoon and many others who
submitted patches


What new in 0.98.4
==

It's been four months since the last matplotlib release, and there are
a lot of new features and bug-fixes

Legend enhancements


Jae-Joon has rewritten the legend class, and added support for
multiple columns and rows, as well as fancy box drawing.  See


http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.legend

http://matplotlib.sourceforge.net/api/artist_api.html#matplotlib.legend.Legend

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


Fancy annotations and arrows
-

Jae-Joon has added lot's of support to annotations for drawing fancy
boxes and connectors in annotations.  See



http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.annotate

http://matplotlib.sourceforge.net/api/artist_api.html#matplotlib.patches.BoxStyle

http://matplotlib.sourceforge.net/api/artist_api.html#matplotlib.patches.ArrowStyle

http://matplotlib.sourceforge.net/api/artist_api.html#matplotlib.patches.ConnectionStyle

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


Native OS X backend


Michiel de Hoon has provided a native Mac OSX backend that is almost
completely implemented in C. The backend can therefore use Quartz
directly and, depending on the application, can be orders of magnitude
faster than the existing backends. In addition, no third-party
libraries are needed other than Python and NumPy. The backend is
interactive from the usual terminal application on Mac using regular
Python. It hasn't been tested with ipython yet, but in principle it
should to work there as well.  Set 'backend : macosx' in your
matplotlibrc file, or run your script with::

> python myfile.py -dmacosx

psd amplitude scaling
-

Ryan May did a lot of work to rationalize the amplitude scaling of
:func:`~matplotlib.pyplot.psd` and friends.  The changes should
increase MATLAB (TM) compatabililty and increase scaling options.


http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.psd

http://matplotlib.sourceforge.net/examples/pylab_examples/psd_demo2.html#pylab-examples-psd-demo2

http://matplotlib.sourceforge.net/examples/pylab_examples/psd_demo3.html#pylab-examples-psd-demo3

Fill between
--

Added a fill_between function to make it easier to do shaded region
plots in the presence of masked data.  You can pass an *x* array and a
*ylower* and *yupper* array to fill betweem, and an optional *where*
argument which is a logical mask where you want to do the filling. See


http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.fill_between

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


Lots more
---

Here are the 0.98.4 notes from the CHANGELOG::

Added mdehoon's native macosx backend from sf patch 2179017 - JDH

Removed the prints in the set_*style commands.  Return the list of
pprinted strings instead - JDH

Some of the changes Michael made to improve the output of the
property tables in the rest docs broke of made difficult to use
some of the interactive doc helpers, eg setp and getp.  Having all
the rest markup in the ipython shell also confused the docstrings.
I added a new rc param docstring.harcopy, to format the docstrings
differently for hardcopy and other use.  Ther ArtistInspector
could use a little refactoring now since there is duplication of
effort between the rest out put and the non-rest output - JDH

Updated spectral methods (psd, csd, etc.) to scale one-sided
densities by a factor of 2 and, optionally, scale all densities by
the sampling frequency.  This gives better MatLab
compatibility. -RM

Fixed alignment of ticks in colorbars. -MGD

drop the deprecated "new" keyword of np.histogram() for numpy 1.2
or later.  -JJL

Fixed a bug in svg backend that new_figure_manager() ignores
keywords arguments such as figsize, etc. -JJL

Fixed a bug that the handlelength of the new legend class set too
short when numpoints=1 -JJL

A

Re: [Matplotlib-users] Any news on wxMPL ?

2008-12-10 Thread Ken McIvor
On Dec 10, 2008, at 6:35 AM, massimo sandal wrote:

> Thanks a lot for your answer. I am very happy to know that you are  
> alive and (mostly) healthy and that you didn't forget us! :)

Oh no, I certainly haven't forgotten about you all!

>> I'm sorry I didn't reply to your email.  It fell through the  
>> cracks, so to speak.
>> WxMpl development has been stalled for quite some time now because  
>> I developed bilateral carpal tunnel syndrome this past spring.  It  
>> was not my intention to leave it abandoned and incompatible with  
>> matplotlib, but I've been finding everything to be a bit of an  
>> uphill battle these days.
>
> Woah, how bad. I'm sorry about that, I hope you're somehow recovering.

Thanks.  I'm going to have some surgery early next year, which will  
hopefully fix things.  I intend to have WxMpl working again and safely  
in matplotlib's repository before then, as I'll be effectively offline  
for six months or so, at least in terms of writing code.

> Thanks a lot for your interest. I didn't have time to go into the  
> wxmpl source, but another guy (Paulo Meira , [EMAIL PROTECTED] ) did  
> a terrific work in bringing wxmpl up to date. I think you could  
> start by contacting him.

Yes, I've had his email with the patch flagged in Mail.app for  
approximately forever.  Thanks for sending me a patched copy of  
wxmpl.py, too.  It'll be very helpful in figuring out the sort of  
changes I need to make.

> Thanks a lot for your feedback again. I develop a data analysis  
> application that uses wx and MPL and your little library made things  
> much easier. Thanks for your wonderful work.

Thank you very much for your kind words.  :-)

Ken

--
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Contour/Contourf misunderstanding?

2008-12-10 Thread Eric Firing
Andrea Gavana wrote:
> Hi Mauro & All,
> 
> On Wed, Dec 10, 2008 at 10:32 AM, Mauro Cavalcanti wrote:
>> Dear Andrea,
>>
>> Greetings. I have tried your script here.
>>
>> 2008/12/10 Andrea Gavana <[EMAIL PROTECTED]>:
>>> I attach my small sample to the message. Am I doing something worng in
>>> my call to contour? Why I am unable to see the 20 contour I specified
>>> in my vector V?
>> But you can. Simply change the line below to:
>>> CS = plt.contourf(X, Y, Z, V=V)
>>> CS = plt.contourf(X, Y, Z, V)
>> (I did not understand the reason behind the "V=V" in the argument list?)
> 
> Ah! I thought "V" was a keyword argument. Shame on me. Thank you for the hint.
> 
>>> Another related problem is with contourf: if I modify the attached
>>> sample to use contourf and clabel, I get this error:
>> Well, this one I do not understand myself.
> 
> Uhm, I will wait for further suggestions. Maybe I am doing something
> stupid, again ;-)

Not stupid at all; it just happens that clabel works only with contour, 
not with contourf.  Clabel operates on the LineCollection generated by 
contour, but contourf generates a PolyCollection.  It should be possible 
to call contourf, then contour, then clabel, and then make the 
LineCollection from contour invisible, but I don't have time now to come 
up with an example.

Eric

> 
> Thank you!
> 
> Andrea.
> 
> "Imagination Is The Only Weapon In The War Against Reality."
> http://xoomer.alice.it/infinity77/
> 
> --
> SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
> The future of the web can't happen without you.  Join us at MIX09 to help
> pave the way to the Next Web now. Learn more and register at
> http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Font problem

2008-12-10 Thread Jörgen Stenarson

Hi,

congratulations on releasing 0.98.4. I especially like the new improved 
possibilities for legends.


I'm trying to understand how to change fonts. But I'm not very 
successful. I use python 2.5 on windows xp with the latest 0.98.4 of 
matplotlib.


I want to create plots that work well with a manuscript in LaTeX using 
the IEEE template. Using that template the regular text comes out in 
Nimbus Roman No 9L, but I can't get matplotlib to use that font.


Using the attached script (with default matplotlibrc) I end up with 
BitstreamVeraSerif-Roman in the resulting pdf. So it seems only Vera is 
recognized. In the attached file 'log.txt' is the output from running 
the script with verbose.level=debug.


From the log it seems the pdfcorefonts are not on the fontpath. But 
still Times New Roman and palatino both are available in the system font 
directory as ttf fonts.


Any ideas on how to fix this

/Jörgen


fonts_problem.py
Description: application/python
matplotlib data path 
C:\Python25\lib\site-packages\matplotlib-0.98.4-py2.5-win32.egg\matplotlib\mpl-data
loaded rc file C:\python\bugreports\matplotlib\matplotlibrc
matplotlib version 0.98.4
verbose.level debug
interactive is False
units is False
platform is win32
loaded modules: ['xml.sax.urlparse', 'distutils', 'matplotlib.errno', 'pylab', 
'subprocess', 'gc', 'matplotlib.tempfile', 'distutils.sysconfig', 
'ctypes._endian', 'encodings.encodings', 'matplotlib.colors', 'msvcrt', 
'numpy.testing.sys', 'numpy.core.info', 'xml', 'numpy.fft.types', 
'numpy.ma.operator', 'numpy.ma.cPickle', 'struct', 'numpy.random.info', 
'tempfile', 'xml.sax.urllib', 'numpy.linalg', 'matplotlib.threading', 
'numpy.testing.operator', 'imp', 'numpy.testing', 'collections', 
'numpy.core.umath', 'numpy.lib.pkgutil', 'distutils.types', 'numpy.lib.numpy', 
'numpy.core.scalarmath', 'matplotlib.matplotlib', 'string', 
'matplotlib.subprocess', 'numpy.testing.os', 'matplotlib.locale', 
'numpy.lib.arraysetops', 'numpy.testing.unittest', 'numpy.lib.math', 
'matplotlib.__future__', 'numpy.testing.re', 'itertools', 'numpy.version', 
'numpy.lib.re', 'distutils.re', 'ctypes.os', 'numpy.core.os', 
'numpy.lib.type_check', 'signal', 'numpy.lib.types', 'numpy.lib._datasource', 
'random', 'threading', 'numpy.fft.fftpack_lite', 'matplotlib.cbook', 
'ctypes.ctypes', 'xml.sax.xmlreader', 'numpy.__builtin__', 'distutils.version', 
'cStringIO', 'numpy.ma.core', 'numpy.numpy', 'matplotlib.StringIO', 'locale', 
'numpy.add_newdocs', 'numpy.lib.getlimits', 'xml.sax.saxutils', 
'numpy.testing.types', 'numpy.lib.sys', 'encodings', 'numpy.ma.itertools', 
'numpy.lib.io', 'numpy.imp', 'numpy.ma.extras', 'numpy.testing.decorators', 
'matplotlib.warnings', 'matplotlib.string', '_subprocess', 'urllib', 
'matplotlib.sys', 're', 'numpy.lib._compiled_base', 'ntpath', 
'numpy.random.mtrand', 'math', 'numpy.fft.helper', 'numpy.ma.warnings', 
'matplotlib.numpy', 'UserDict', 'numpy.lib.function_base', 'distutils.os', 
'matplotlib', 'numpy.fft.numpy', 'numpy.lib.ufunclike', 'numpy.lib.info', 
'numpy.core.numerictypes', 'ctypes', 'numpy.lib.warnings', 'ctypes.struct', 
'codecs', 'numpy.core._sort', 'numpy.os', '_locale', 
'matplotlib.sre_constants', 'matplotlib.os', 'thread', 'StringIO', 
'numpy.core.memmap', 'traceback', '_struct', 'numpy.testing.warnings', 
'weakref', 'numpy.core._internal', 'numpy.fft.fftpack', 'numpy.testing.imp', 
'numpy.linalg.lapack_lite', 'distutils.sys', 'os', 'numpy.lib.itertools', 
'__future__', 'matplotlib.copy', 'xml.sax.types', 'matplotlib.traceback', 
'_sre', 'unittest', 'numpy.core.sys', 'numpy.random', 'numpy.linalg.numpy', 
'__builtin__', 'numpy.lib.twodim_base', 'matplotlib.re', 'numpy.core.cPickle', 
'operator', 'numpy.testing.parametric', 'numpy.core.arrayprint', 
'distutils.string', 'numpy.lib.arrayterator', 'ctypes._ctypes', 'ctypes.sys', 
'matplotlib.datetime', 'numpy.testing.nosetester', 'pkgutil', 
'numpy.lib.financial', 'numpy.core.multiarray', 'errno', '_socket', 'binascii', 
'sre_constants', 'datetime', 'numpy.ma', 'xml.sax.handler', 'types', 
'numpy.lib.stride_tricks', 'numpy.core.numpy', 'numpy', 'matplotlib.types', 
'numpy.core.defmatrix', 'xml.sax.os', 'cPickle', 'matplotlib.xml', '_codecs', 
'numpy.lib.operator', 'encodings.cp1252', 'matplotlib.pyparsing', 'nturl2path', 
'numpy.ma.numpy', 'copy', 'numpy.core.re', 'socket', '_types', 
'numpy.core.fromnumeric', 'numpy.ctypeslib', 'numpy.lib.scimath', 'numpy.fft', 
'numpy.lib', 'numpy.random.numpy', 'encodings.aliases', 'matplotlib.distutils', 
'exceptions', 'sre_parse', 'numpy.core.cStringIO', 'numpy.core.ctypes', 
'distutils.distutils', 'copy_reg', 'sre_compile', 'xml.sax', '_random', 
'numpy.lib.__future__', 'site', 'numpy.lib.polynomial', 'numpy._import_tools', 
'numpy.core.copy_reg', 'zipimport', '__main__', 'numpy.fft.info', 
'numpy.core.records', 'shutil', 'numpy.lib.cPickle', 'numpy.sys', 
'matplotlib.weakref', 'numpy.core._dotblas', 'numpy.testing.traceback', 
'strop', 'numpy.testing.numpytest', 'numpy.core.nu

[Matplotlib-users] Status of Axes3d

2008-12-10 Thread Ryan Wagner
Hi Everyone,
Does anyone know the long term plans of fixing Axes3d / Mplot3D in MPL? Is 
this ever going to be re-incorporated in this library in the future? Just 
wondering...
-Ryan Wagner

--
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Font problem

2008-12-10 Thread Michael Droettboom
Unfortunately, I think this is a bug.  The ordering of fonts in the 
family list is being ignored, and Bitstream Vera Sans is winning over 
Nimbus Roman for reasons other than its name.  I'll have to get this 
patch in for the bugfix release we're already planning.

As a workaround, try putting only "Nimbus Roman No9 L" as the only font 
in the list.  Does that help?

Also, I don't see the Nimbus Roman font file (n021003l.ttf) anywhere in 
the debugging output.  Are you sure it's in C:\Windows\Fonts ?

Mike

Jörgen Stenarson wrote:
> Hi,
>
> congratulations on releasing 0.98.4. I especially like the new 
> improved possibilities for legends.
>
> I'm trying to understand how to change fonts. But I'm not very 
> successful. I use python 2.5 on windows xp with the latest 0.98.4 of 
> matplotlib.
>
> I want to create plots that work well with a manuscript in LaTeX using 
> the IEEE template. Using that template the regular text comes out in 
> Nimbus Roman No 9L, but I can't get matplotlib to use that font.
>
> Using the attached script (with default matplotlibrc) I end up with 
> BitstreamVeraSerif-Roman in the resulting pdf. So it seems only Vera 
> is recognized. In the attached file 'log.txt' is the output from 
> running the script with verbose.level=debug.
>
> From the log it seems the pdfcorefonts are not on the fontpath. But 
> still Times New Roman and palatino both are available in the system 
> font directory as ttf fonts.
>
> Any ideas on how to fix this
>
> /Jörgen
> 
>
> --
> SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
> The future of the web can't happen without you.  Join us at MIX09 to help
> pave the way to the Next Web now. Learn more and register at
> http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
> 
>
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] axvspan/axhspan doesn't understand keyword arguments

2008-12-10 Thread Sara Hatch
I ran into a little problem when adding an axis span (both vertical and
horizontal) to my plot. When I use the optional keyword arguments, I get an
error message:

import pylab
pylab.axhspan(0.25, 0.75, facecolor='0.5', alpha=0.5)
Traceback (most recent call last):
  File "", line 1, in 
  File "/lib/python2.5/site-packages/matplotlib/pyplot.py", line 1572, in
axhspan
ret =  gca().axhspan(*args, **kwargs)
  File "/lib/python2.5/site-packages/matplotlib/axes.py", line 2883, in
axhspan
self._process_unit_info( [xmin, xmax], [ymin, ymax], **kwargs )
TypeError: _process_unit_info() got an unexpected keyword argument 'alpha'

Granted, I can get the results I want using the .set_xxx() methods, but my
first method should have worked, right?

I've never filed a bug for matplotlib before, so I figured I'd send out an
email to the users-group first.

Thanks,
Sara
--
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Legends for multi-histograms

2008-12-10 Thread Zane Selvans
It seems like there ought to be an easy way to associate labels with  
the various groups of patches generated by a call to hist() that uses  
a list of arrays, setting label=["a", "list", "of", "strings"] for  
instance, instead of having to go in and label one patch from each  
returned list of patches afterward.  Would make legend creation easier  
anyway.


Just a suggestion,
Zane

--
Zane Selvans
Amateur Earthling
[EMAIL PROTECTED]
303/815-6866
http://zaneselvans.org
PGP Key: 55E0815F








--
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Font problem

2008-12-10 Thread Jörgen Stenarson
Michael Droettboom skrev:
> Unfortunately, I think this is a bug.  The ordering of fonts in the 
> family list is being ignored, and Bitstream Vera Sans is winning over 
> Nimbus Roman for reasons other than its name.  I'll have to get this 
> patch in for the bugfix release we're already planning.
> 
> As a workaround, try putting only "Nimbus Roman No9 L" as the only font 
> in the list.  Does that help?
> 
> Also, I don't see the Nimbus Roman font file (n021003l.ttf) anywhere in 
> the debugging output.  Are you sure it's in C:\Windows\Fonts ?
> 
> Mike
> 

As you say it seems only one font at a time can be specified. These are 
the ones I have managed to use by only specifying a single font: Times 
New Roman, Georgia, Euclid, Arial, Vera.

It seems the Nimbus Roman my LaTeX installation uses is from utmr8a.pfm 
and utmr8a.pfb some kind of Type 1 font. I can install the pfm file in 
the system font directory but not the pfb files, anyway matplotlib won't 
use it. Is there a free ttf version available somewhere or is it 
possible to put the pfm/pfb files it somewhere else and have matplotlib 
use it?


Thanks for looking in to this,
Jörgen


--
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] axvspan/axhspan doesn't understand keyword arguments

2008-12-10 Thread Eric Firing
Sara Hatch wrote:
> I ran into a little problem when adding an axis span (both vertical and 
> horizontal) to my plot. When I use the optional keyword arguments, I get 
> an error message:
> 
> import pylab
> pylab.axhspan(0.25, 0.75, facecolor='0.5', alpha=0.5)
> Traceback (most recent call last):
>   File "", line 1, in 
>   File "/lib/python2.5/site-packages/matplotlib/pyplot.py", line 1572, 
> in axhspan
> ret =  gca().axhspan(*args, **kwargs)
>   File "/lib/python2.5/site-packages/matplotlib/axes.py", line 2883, in 
> axhspan
> self._process_unit_info( [xmin, xmax], [ymin, ymax], **kwargs )
> TypeError: _process_unit_info() got an unexpected keyword argument 'alpha'
> 
> Granted, I can get the results I want using the .set_xxx() methods, but 
> my first method should have worked, right?
> 
> I've never filed a bug for matplotlib before, so I figured I'd send out 
> an email to the users-group first. 

Sara,

Thank you, that is indeed the right thing to do. In addition, please 
state what matplotlib version you are using.  Often, although not in 
this case, it is also critical to know what operating system you are 
using, and the numpy version.

You have definitely hit a bug, but it has been fixed--I don't see it in 
svn.  I don't know how long ago it was fixed.  A new release of mpl has 
just come out.  Can you upgrade?

Eric


> 
> Thanks,
> Sara
> 
> 
> 
> 
> --
> SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
> The future of the web can't happen without you.  Join us at MIX09 to help
> pave the way to the Next Web now. Learn more and register at
> http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
> 
> 
> 
> 
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Anyone see this after upgrading?

2008-12-10 Thread Ryan Wagner
Just upgraded to 98.4. Can reproduce this on two XP32 boxes. Any thoughts?


C:\Documents and Settings\rwagner\Desktop>python
Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from pylab import *
Traceback (most recent call last):
  File "", line 1, in 
  File "C:\Python25\Lib\site-packages\pylab.py", line 1, in 
from matplotlib.pylab import *
  File "C:\Python25\Lib\site-packages\matplotlib\pylab.py", line 253, in 
from matplotlib.pyplot import *
  File "C:\Python25\Lib\site-packages\matplotlib\pyplot.py", line 75, in 
new_figure_manager, draw_if_interactive, show = pylab_setup()
  File "C:\Python25\Lib\site-packages\matplotlib\backends\__init__.py", line 25,
 in pylab_setup
globals(),locals(),[backend_name])
  File "C:\Python25\Lib\site-packages\matplotlib\backends\backend_gtkagg.py", li
ne 10, in 
from matplotlib.backends.backend_gtk import gtk, FigureManagerGTK, FigureCan
vasGTK,\
  File "C:\Python25\Lib\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.
>>>



--
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] blit example on MacOS with ipython

2008-12-10 Thread pierre garrigues
Hi,
I have taken the blit example and modified it such that it runs on my mac.
The function is called blit_ex.py. It works well when I paste the code in
ipython, but it doesn't when I do "run blit_ex.py" from ipython.
I am using EPD Py25 4.1.30001_beta1 and Mac OS 10.5.

The error message is:

In [1]: run blit_ex.py
---
AssertionErrorTraceback (most recent call last)

/Users/pierre/Desktop/blit_ex.py in ()
 24 canvas.restore_region(background)
 25 line.set_ydata(np.sin(x+i/10.))
---> 26 ax.draw_artist(line)
 27 canvas.blit(ax.bbox)
 28

/Library/Frameworks/Python.framework/Versions/4.1.30001/lib/python2.5/site-packages/matplotlib-0.98.3.0001-py2.5-macosx-10.3-fat.egg/matplotlib/axes.pyc
in draw_artist(self, a)
   1532 data (axis ticks, labels, etc are not updated)
   1533 """
-> 1534 assert self._cachedRenderer is not None
   1535 a.draw(self._cachedRenderer)
   1536

AssertionError:
WARNING: Failure executing file: 

And the code is

import matplotlib.pyplot as plt
import numpy as np
import time

plt.figure(1)
plt.clf()

ax = plt.subplot(111)
canvas = ax.figure.canvas

# for profiling
tstart = time.time()

# create the initial line
x = np.linspace(-3, 3, 1000)
line, = plt.plot(x, np.sin(x), animated=True)

# save the clean slate background -- everything but the animated line
# is drawn and saved in the pixel buffer background
background = canvas.copy_from_bbox(ax.bbox)

for i in range(100):

canvas.restore_region(background)
line.set_ydata(np.sin(x+i/10.))
ax.draw_artist(line)
canvas.blit(ax.bbox)


Thanks!
Pierre
--
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Font problem

2008-12-10 Thread Michael Droettboom
Jörgen Stenarson wrote:
> Michael Droettboom skrev:
>> Unfortunately, I think this is a bug.  The ordering of fonts in the 
>> family list is being ignored, and Bitstream Vera Sans is winning over 
>> Nimbus Roman for reasons other than its name.  I'll have to get this 
>> patch in for the bugfix release we're already planning.
>>
>> As a workaround, try putting only "Nimbus Roman No9 L" as the only 
>> font in the list.  Does that help?
>>
>> Also, I don't see the Nimbus Roman font file (n021003l.ttf) anywhere 
>> in the debugging output.  Are you sure it's in C:\Windows\Fonts ?
>>
>> Mike
>>
>
> As you say it seems only one font at a time can be specified. These 
> are the ones I have managed to use by only specifying a single font: 
> Times New Roman, Georgia, Euclid, Arial, Vera.
>
> It seems the Nimbus Roman my LaTeX installation uses is from 
> utmr8a.pfm and utmr8a.pfb some kind of Type 1 font. I can install the 
> pfm file in the system font directory but not the pfb files, anyway 
> matplotlib won't use it. 
That is correct.  matplotlib can only use ttf files (or the standard 14 
Postscript files when outputting Postscript).
> Is there a free ttf version available somewhere or is it possible to 
> put the pfm/pfb files it somewhere else and have matplotlib use it?
I believe Nimbus Roman is just a clone of Times that is included with 
Ghostscript.

http://www.tug.dk/FontCatalogue/nimbus/

If you have Times or Times New Roman installed, that's probably a 
reasonable substitute.

Cheers,
Mike

--
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Anyone see this after upgrading?

2008-12-10 Thread John Hunter
On Wed, Dec 10, 2008 at 5:01 PM, Ryan Wagner <[EMAIL PROTECTED]> wrote:

>  Just upgraded to 98.4. Can reproduce this on two XP32 boxes. Any
> thoughts?
>

This is a bug in the win32 installer, which has gtkagg set as the default
backend.  You can fix this by setting TkAgg in the backend, which is what we
*should* have done in the installer.  You need to change the line

  backend : GTKAgg

to

  backend : TkAgg

in your matplotlibrc config file.  Instructions for editing the rc file can
be found at http://matplotlib.sourceforge.net/users/customizing.html.  You
can also read about "what is a backend?" here -
http://matplotlib.sourceforge.net/faq/installing_faq.html#id1

We will be putting out new installers that fix this problem ASAP, so those
of you who on windows who have not yet installed 98.4 may prefer to wait
until we announce the fixed installers are up.  This problem does not affect
the src tarball or the os x installers.

Sorry for the trouble!
JDH
--
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] blit example on MacOS with ipython

2008-12-10 Thread John Hunter
On Wed, Dec 10, 2008 at 5:20 PM, pierre garrigues <
[EMAIL PROTECTED]> wrote:

>
> # create the initial line
> x = np.linspace(-3, 3, 1000)
> line, = plt.plot(x, np.sin(x), animated=True)
>
> # save the clean slate background -- everything but the animated line
> # is drawn and saved in the pixel buffer background
> background = canvas.copy_from_bbox(ax.bbox)
>

It looks to me that you need to force a figure draw *before* doing
copy_from_bbox.  Eg::

fig.canvas.draw()
background = canvas.copy_from_bbox(ax.bbox)

The reason you are seeing a difference between ipython "run" and ipython
copy-and-paste is that in "run" mode ipython turns interactive drawing off
(for details see http://matplotlib.sourceforge.net/users/shell.html) so the
draw event is never called, and the cached renderer, which is triggering
your exception, is never set.

This is speculation, as I haven't tested, so please answer back if this
fixes your problem and if so I will update the matplotlib animation recipe
which also suffers from this problem (which is not exposed unless you are
running in interactive mode, which you are).  It is on my list of things to
do to write a proper animation chapter for the user's guide

JDH
--
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Website buglet

2008-12-10 Thread Scott Sinclair
Hi,

I noticed that there is a problem rendering the plot here:

http://matplotlib.sourceforge.net/users/screenshots.html#basemap-demo

It might be something to do with the location of the data required by
the plotmap.py demo script (line 14).

Cheers,
Scott

--
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users