Re: [Matplotlib-users] Pylab breaks locales with GTK

2009-01-05 Thread Michael Droettboom
It's a bug with PyGTK in that merely importing it sets the locale.

But more seriously, it's also a bug in Numpy, in that its string 
formatting is dependent on locale (unlike standard floats in Python).

See this Numpy bug:

http://projects.scipy.org/scipy/numpy/ticket/902
*
*and this mailing list thread:

http://www.mail-archive.com/numpy-discuss...@scipy.org/msg14563.html

Cheers,
Mike

Ryan May wrote:
 Lionel Roubeyrie wrote:
   
 Hi all,
 Trying to write to text files some plotted datas, we have a strange
 behavour on masked arrays after importing pylab, with the dot decimal
 separator replaced by a comma (but not all) : 
 ##
 Python 2.5.2 (r252:60911, Oct  5 2008, 19:24:49) 
 [GCC 4.3.2] on linux2
 Type help, copyright, credits or license for more information.
 

 This has been reported before, and IIRC, it's a problem with PyGTK.

 Ryan

   

-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA


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


Re: [Matplotlib-users] Switching between different font settings

2009-01-05 Thread Jouni K . Seppänen
Johan Ekh ekh.jo...@gmail.com writes:

 So far I've tried reading a file with settings specific to the current
 document and using rcParams.update(params) to dynamically change the
 settings.

This seems to me to be a good way of switching between settings.

 This way I can get the right font for legends and labels, but
 I have not figured out how to get correct fonts for the numbers
 on the x- and y-axes. Matplotlib uses whatever is default in my LaTeX
 installation (Computer Modern?). I use text.usetex: True.

The usetex support attempts to select a font from the same list used by
matplotlib otherwise. I'm not sure if it's properly documented anywhere,
but the machinery is in texmanager.py, and here's the relevant data
structure:

font_info = {'new century schoolbook': ('pnc',
r'\renewcommand{\rmdefault}{pnc}'),
'bookman': ('pbk', r'\renewcommand{\rmdefault}{pbk}'),
'times': ('ptm', r'\usepackage{mathptmx}'),
'palatino': ('ppl', r'\usepackage{mathpazo}'),
'zapf chancery': ('pzc', r'\usepackage{chancery}'),
'cursive': ('pzc', r'\usepackage{chancery}'),
'charter': ('pch', r'\usepackage{charter}'),
'serif': ('cmr', ''),
'sans-serif': ('cmss', ''),
'helvetica': ('phv', r'\usepackage{helvet}'),
'avant garde': ('pag', r'\usepackage{avant}'),
'courier': ('pcr', r'\usepackage{courier}'),
'monospace': ('cmtt', ''),
'computer modern roman': ('cmr', ''),
'computer modern sans serif': ('cmss', ''),
'computer modern typewriter': ('cmtt', '')}

What font are you trying to use? Is it one of those listed above?

Since you say that you get the right font for legends and labels but not
for tick labels, perhaps the problem is with math mode. What font do you
get if you typeset a formula? Try something like

  text(r'$1+2+3={}$1+2+3')

to see if the math font is different from the text font.

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


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


Re: [Matplotlib-users] print_figure with animated objects

2009-01-05 Thread John Hunter
On Mon, Jan 5, 2009 at 9:30 AM,  zndlf-...@yahoo.es wrote:

 but doing so does not save the lines.
 The only workaround I've found is to set animated=false for all the objects,
 print the figure and then set animated=true again.

Yes, that is the way to do it -- we could add some logic to savefig to do this.

JDH

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


Re: [Matplotlib-users] problems returning to main program after ploting a figure

2009-01-05 Thread flo_wer


It looks like you are trying to use pyplot is an embedded GUI and you
might be better off trying to embed mpl in the GUI following the
examples at...

You were right about that. Thanks for the refererences. it helped a lot. The
code is a bit longer now and contains parts from the examples that are hard
for me to fully understand, but it works!!


Florian


-- 
View this message in context: 
http://www.nabble.com/problems-returning-to-main-program-after-ploting-a-figure-tp21292503p21294467.html
Sent from the matplotlib - users mailing list archive at Nabble.com.


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


Re: [Matplotlib-users] getting text size _before_ plotting

2009-01-05 Thread Jeff Whitaker
Michael Hearne wrote:
 All:  I'm trying to make a map (using Basemap), and plot names of cities 
 on that map.  I'd like to avoid collisions of city names (where the 
 bounding boxes of the text objects would overlap), but I'm having 
 trouble figuring out how I can do this without actually drawing the text 
 on the figure.

 I found this thread:

 http://osdir.com/ml/python.matplotlib.general/2005-02/msg00174.html

 which describes how to do it _after_ drawing the text on the plot.  This 
 would only be useful to me if there were some way to un-draw the text, 
 which isn't something I know how to do either.
   

Michael:  Each Text instance that you add to the plot has a remove 
method that you can call to 'undraw' it.

-Jeff
 Figure resizing is not a problem for my application.

 Java has a FontMetrics class, which tells you how big a string will be 
 in a given font - is there an equivalent for Matplotlib?

 --Mike

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


-- 
Jeffrey S. Whitaker Phone  : (303)497-6313
Meteorologist   FAX: (303)497-6449
NOAA/OAR/PSD  R/PSD1Email  : jeffrey.s.whita...@noaa.gov
325 BroadwayOffice : Skaggs Research Cntr 1D-113
Boulder, CO, USA 80303-3328 Web: http://tinyurl.com/5telg


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


[Matplotlib-users] Colormap range and data values

2009-01-05 Thread antonv

Hi all,

I have an issue with the colormap for my plots. The data I'm plotting ranges
between 0 and 24 but I am trying to have the colormap display values from 0
to 30. What happens is that the colormap reads the min and max values in my
data and uses those disregarding the vmin and vmax set.

Here is a snippet of code to show how I'm using the colormap:

cmap= mpl.cm.jet
norm= mpl.colors.Normalize(vmin=0,vmax=30)
..
m.contourf(X,Y, zi, cmap = cmap, norm = norm)

Another question is how can you setup the levels displyed in the colormap.
In my previous example they are st at 0,3,6,9,12,...24. How can I make them
every 2 values or every 1 value?

Thanks,
Anton
-- 
View this message in context: 
http://www.nabble.com/Colormap-range-and-data-values-tp2129p2129.html
Sent from the matplotlib - users mailing list archive at Nabble.com.


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


[Matplotlib-users] problems returning to main program after ploting a figure

2009-01-05 Thread flo_wer

Hi,
I am using matplotlib to create a figure in a pythonCard script that looks
like this

def on_button_mouseClick(self, event):
import matplotlib.pyplot as plt

plt.figure(1)
for point in list:
plt.plot([x],[y],'bo')
plt.title('Water balance %10s' % Gew_Name[0])
plt.xlabel('Station in km')
plt.ylabel('Flux in L/s')
plt.show()

plt.clf()

My problem is that the program will not continue after that. I tried to look
for commands to delete the figure but clf() was all I found. I am working
with windows xp and the idle shell. To close idle is the only thing that
helps. I intended to produce some more figures after the script has
calculated balances for a stream network. As you might have noticed, I am
not a python expert so please excuse my humpy description of the problem.
Thanks,
Florian
-- 
View this message in context: 
http://www.nabble.com/problems-returning-to-main-program-after-ploting-a-figure-tp21292503p21292503.html
Sent from the matplotlib - users mailing list archive at Nabble.com.


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


Re: [Matplotlib-users] [matplotlib-devel] What would you like to see in a book about Matplotlib?

2009-01-05 Thread Andrew Straw
Hi Sandro,

It's great news that a book may come out on MPL.

Speaking as an aspiring university professor in neuroscience, I would
like to see something that could be used as a resource for undergraduate
students just learning Python and MPL. Due to this perspective, I think
such a book would cover both numpy and MPL. The emphasis could clearly
by on MPL, but basic numpy idioms and concepts should also be taught. I
think an example-driven approach would be very useful -- something like
an undergraduate laboratory experiment where students measure and plot
raw values and compute histograms and statistics (e.g. mean and std).
More advanced sections might perform statistical comparisons of
different treatments (e.g. using chi squared, KS and/or T tests), do
linear least squares fitting (with np.linalg.lstsq), and possibly
non-linear curve fitting using something like scipy.optimize.fmin.

That's my self-serving $0.02, since you asked! :)

You may also want to speak with John Hunter and Fernando Perez about the
possibility of collaborating -- they've already done some work towards a
book, too.

Andrew

Sandro Tosi wrote:
 Hello and Happy 2009!
 
 I received the interesting proposal to author a book on Matplotlib,
 the powerful 2D plotting library for Python.
 
 While preparing the arguments list, I'd like to hear even your
 opinion, because different points-of-view will lead to a better
 product.
 
 Some basic question I'd like to ask are:
 
 - what are you using matplotlib for?
 - what are the things you like the most of matplotlib, that you want
 to give emphasis to? And why?
 - what are the (basic) things that, when you were beginning to use
 matplotlib, you wanted to see grouped up but couldn't find?
 - what would you like to see in a book about matplotlib?
 - what are some those advanced feature that made you yell WOW!! ?
 - what are the things you'd like to explore of matplotlib and never
 had time to do?
 
 Your suggestions are really appreciated :) And wish me good luck!
 
 Cheers,


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


[Matplotlib-users] Pylab breaks locales with GTK

2009-01-05 Thread Lionel Roubeyrie
Hi all,
Trying to write to text files some plotted datas, we have a strange
behavour on masked arrays after importing pylab, with the dot decimal
separator replaced by a comma (but not all) : 
##
Python 2.5.2 (r252:60911, Oct  5 2008, 19:24:49) 
[GCC 4.3.2] on linux2
Type help, copyright, credits or license for more information.
 import numpy as np
 a=np.ma.array([1., 1.01, 2.11, 3.61])
 for i in a:str(i)
... 
'1.0'
'1.01'
'2.11'
'3.61'
 import matplotlib
 for i in a:str(i)
... 
'1.0'
'1.01'
'2.11'
'3.61'
 import pylab
 for i in a:str(i)
... 
'1.0'
'1,01'
'2,11'
'3,61'
 np.__version__, matplotlib.__version__
('1.2.1', '0.98.3')
#

Any help welcomes!

-- 
Lionel Roubeyrie
chargé d'études
LIMAIR - La Surveillance de l'Air en Limousin
http://www.limair.asso.fr



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


[Matplotlib-users] print_figure with animated objects

2009-01-05 Thread zndlf-web
Hello:

I would like to know how to print_figure or savefig with animated elements. The 
only thing I get is the axis but no animated objects.

The idea is that I've written a program embedding matplotlib in wx and then I 
create plots and animations in a similar way as in the example 
animation_blit_wx.py. 
In that way, I do something like:

lines, = self.axes.plot(x,y,animated=True)
background = self.canvas.copy_from_bbox(self.figure.bbox)

and afterwards, I create some animation by updating the ydata in the following 
way:

self.canvas.restore_region(background)
lines.set_ydata(value)
self.axes.draw_artist(lines)
self.canvas.blit(self.figure.bbox)

and now I would like to save the picture:

self.canvas.print_figure(filename, format)

but doing so does not save the lines.
The only workaround I've found is to set animated=false for all the objects, 
print the figure and then set animated=true again.

Thanks,

Thomas




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


Re: [Matplotlib-users] What would you like to see in a book about Matplotlib?

2009-01-05 Thread Russell E. Owen
In article 
8b2d7b4d0901050152p4c7487a8m21fb7fb823297...@mail.gmail.com,
 Sandro Tosi mo...@debian.org wrote:

 Hello and Happy 2009!
 
 I received the interesting proposal to author a book on Matplotlib,
 the powerful 2D plotting library for Python.
 
 While preparing the arguments list, I'd like to hear even your
 opinion, because different points-of-view will lead to a better
 product.
 
 Some basic question I'd like to ask are:
 
 - what are you using matplotlib for?

Plotting data from a networked Tkinter application.

 - what are the (basic) things that, when you were beginning to use
 matplotlib, you wanted to see grouped up but couldn't find?
 - what would you like to see in a book about matplotlib?

I want a user's guide for the class API. So far I've figured it out by 
reading examples, trying to extrapolate from the pylab user's guide 
(which is quite good) and reading the class API reference, but I feel 
that I barely understand what I am doing.

 - what are the things you'd like to explore of matplotlib and never
 had time to do?

I'd like to know how best to handle plotting data as it arrives (e.g. 
strip charts and evolving x-y plots). I've got code that works but am 
not convinced I'm doing it in the best fashion.

Histograms.

-- Russell


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


[Matplotlib-users] typecode() in mlab.cohere_pairs

2009-01-05 Thread Sven Schreiber
Hi,

I'm stumbling (=getting an error) over the fact that cohere_pairs in the
mlab module makes use of an unknown typecode() function. I'm guessing
that typecode(X) comes from the pre-numpy era, and maybe it should be
X.dtype or X.dtype.char or whatever.

Is this a known bug, is it a bug at all, or what's happening?

oh, I'm using a standard package setup on current Ubuntu 8.10, so in
particular this should mean mpl version 0.98.3 and numpy 1.1.1. But I
have checked the bleeding edge mlab in svn and at least the typecode(X)
thing appears to be still there.

thanks,
sven

(it would be very nice if you cc me in this thread, but of course I
understand if the list's settings might make it impractical)

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


Re: [Matplotlib-users] How to get Text dimensions

2009-01-05 Thread Matthias Michler
On Monday 22 December 2008 14:24:06 Franta wrote:
 Hi,

 when I have a Text instance, how can I get the dimensions of it?

Hello,

I think with dimensions you mean the width height and/or the corresponding 
corners of the box surrounding the text (its bounding box). I attached an 
example, which illustrates my solution. I hope it is useful to you.

regards Matthias


get_text_limits.py
Description: application/python
--
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] getting text size _before_ plotting

2009-01-05 Thread Michael Hearne
All:  I'm trying to make a map (using Basemap), and plot names of cities 
on that map.  I'd like to avoid collisions of city names (where the 
bounding boxes of the text objects would overlap), but I'm having 
trouble figuring out how I can do this without actually drawing the text 
on the figure.

I found this thread:

http://osdir.com/ml/python.matplotlib.general/2005-02/msg00174.html

which describes how to do it _after_ drawing the text on the plot.  This 
would only be useful to me if there were some way to un-draw the text, 
which isn't something I know how to do either.

Figure resizing is not a problem for my application.

Java has a FontMetrics class, which tells you how big a string will be 
in a given font - is there an equivalent for Matplotlib?

--Mike

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


Re: [Matplotlib-users] Pylab breaks locales with GTK

2009-01-05 Thread Lionel Roubeyrie
Thanks for your responses,
Looking comments in the tickets, putting 
import locale
locale.setlocale(locale.LC_NUMERIC, 'C')
after the pylab import resolves the problem (but not the bug...).

Have a happy new year

Le lundi 05 janvier 2009 à 15:37 +0100, Lionel Roubeyrie a écrit :
 Hi all,
 Trying to write to text files some plotted datas, we have a strange
 behavour on masked arrays after importing pylab, with the dot decimal
 separator replaced by a comma (but not all) : 
 ##
 Python 2.5.2 (r252:60911, Oct  5 2008, 19:24:49) 
 [GCC 4.3.2] on linux2
 Type help, copyright, credits or license for more information.
  import numpy as np
  a=np.ma.array([1., 1.01, 2.11, 3.61])
  for i in a:str(i)
 ... 
 '1.0'
 '1.01'
 '2.11'
 '3.61'
  import matplotlib
  for i in a:str(i)
 ... 
 '1.0'
 '1.01'
 '2.11'
 '3.61'
  import pylab
  for i in a:str(i)
 ... 
 '1.0'
 '1,01'
 '2,11'
 '3,61'
  np.__version__, matplotlib.__version__
 ('1.2.1', '0.98.3')
 #
 
 Any help welcomes!
 
-- 
Lionel Roubeyrie
chargé d'études
LIMAIR - La Surveillance de l'Air en Limousin
http://www.limair.asso.fr



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


[Matplotlib-users] ploting a logarithmic regression to scattered data ?

2009-01-05 Thread Oz Nahum
Hi,
I can't find a way to do a logarithmic regression in matplotlib,
This can be done relatively easily in spread sheets like gnumeric and excel.

Has anyone got a clue how to do it ?
Thanks, Oz.

-- 


   Imagine there's no countries
   It isn't hard to do
   Nothing to kill or die for
   And no religion too
   Imagine all the people
   Living life in peace

---
when one person suffers from a delusion it is called insanity. When many
people suffer from a delusion it is called religion.
Robert Pirsig, Zen and the Art of Motorcycle Maintenance
--
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Pylab breaks locales with GTK

2009-01-05 Thread David Cournapeau
Hi Ryan,

Ryan May wrote:
 Lionel Roubeyrie wrote:
   
 Hi all,
 Trying to write to text files some plotted datas, we have a strange
 behavour on masked arrays after importing pylab, with the dot decimal
 separator replaced by a comma (but not all) : 
 ##
 Python 2.5.2 (r252:60911, Oct  5 2008, 19:24:49) 
 [GCC 4.3.2] on linux2
 Type help, copyright, credits or license for more information.
 

 This has been reported before, and IIRC, it's a problem with PyGTK.
   

The fact that pygtk changes the local at import sounds buggy indeed, but
numpy should not be dependent on the locale anyway, so it also shows a
numpy bug I think:

http://scipy.org/scipy/numpy/ticket/884

Pauli and other have been working on those locale-related bugs in numpy,
but they are a bit fastidious to fix - hopefully, they will make their
way into numpy 1.3

David

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


Re: [Matplotlib-users] Pylab breaks locales with GTK

2009-01-05 Thread Ryan May
Lionel Roubeyrie wrote:
 Hi all,
 Trying to write to text files some plotted datas, we have a strange
 behavour on masked arrays after importing pylab, with the dot decimal
 separator replaced by a comma (but not all) : 
 ##
 Python 2.5.2 (r252:60911, Oct  5 2008, 19:24:49) 
 [GCC 4.3.2] on linux2
 Type help, copyright, credits or license for more information.

This has been reported before, and IIRC, it's a problem with PyGTK.

Ryan

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

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


Re: [Matplotlib-users] Pylab breaks locales with GTK

2009-01-05 Thread Michael Droettboom
This seems to be a bug (or at least inconsistent behavior) in numpy when 
the locale is set (which happens when gtk is imported -- replace 'import 
pylab' with 'import gtk' and you'll see the same behavior).

We actually use a workaround for this in other parts of matplotlib, 
which is:

  for i in a: str(float(i))

By forcing the conversion to a Python float first, you can get around 
the localized number output.

I'll follow up with this on the numpy bug tracker or mailing list, since 
this has been a long-standing niggle of mine as well.

Cheers,
Mike

Lionel Roubeyrie wrote:
 Hi all,
 Trying to write to text files some plotted datas, we have a strange
 behavour on masked arrays after importing pylab, with the dot decimal
 separator replaced by a comma (but not all) : 
 ##
 Python 2.5.2 (r252:60911, Oct  5 2008, 19:24:49) 
 [GCC 4.3.2] on linux2
 Type help, copyright, credits or license for more information.
   
 import numpy as np
 a=np.ma.array([1., 1.01, 2.11, 3.61])
 for i in a:str(i)
 
 ... 
 '1.0'
 '1.01'
 '2.11'
 '3.61'
   
 import matplotlib
 for i in a:str(i)
 
 ... 
 '1.0'
 '1.01'
 '2.11'
 '3.61'
   
 import pylab
 for i in a:str(i)
 
 ... 
 '1.0'
 '1,01'
 '2,11'
 '3,61'
   
 np.__version__, matplotlib.__version__
 
 ('1.2.1', '0.98.3')
 #

 Any help welcomes!

   

-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA


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


Re: [Matplotlib-users] What would you like to see in a book about Matplotlib?

2009-01-05 Thread João Luís Silva
Sandro Tosi wrote:
 Hello and Happy 2009!

Hi,

 
 I received the interesting proposal to author a book on Matplotlib,
 the powerful 2D plotting library for Python.
 
 While preparing the arguments list, I'd like to hear even your
 opinion, because different points-of-view will lead to a better
 product.
 
 Some basic question I'd like to ask are:
 
 - what are you using matplotlib for?

I'm using it for scientific visualization and to create graphics for 
publications.

 - what are the things you like the most of matplotlib, that you want
 to give emphasis to? And why?

The best thing for me about matplotlib is its publication quality. The 
nice clean anti-aliased graphics really look good, and made it an 
obvious choice when I was looking for graphic packages. The fact that 
it's based on python is even better for me, because that's what I was 
already using for scripting. The simple pyplot interface is also a plus, 
you can started producing great looking graphics almost immediately.

 - what are the (basic) things that, when you were beginning to use
 matplotlib, you wanted to see grouped up but couldn't find?

I don't know if you consider it basic or not, but I would have liked 
better documentation of the object oriented interface (matplotlib). The 
pylab / pyplot interface is in general simple enough. As I started using 
this project some time ago its documentation wasn't as complete as it is 
now.

 - what would you like to see in a book about matplotlib?

As above, at least a chapter about the object oriented interface showing 
how to embed matplotlib on a application, and outlining the structure of 
the OO interface.

 - what are some those advanced feature that made you yell WOW!! ?

I haven't really used matplotlib's advanced features. There are some 
that I like, such as automatic legend placement and mathtext support. 
The number of supported backends is impressive just by itself, making 
matplotlib much more useful. There are some little things such as the 
search order for the matplotlibrc file that make it possible to specify 
  different settings for a given directory.

Although not a feature, another thing that impressed me was the quality 
of the source code, it's very clean an well structured.

 - what are the things you'd like to explore of matplotlib and never
 had time to do?

I never had the time to try the masked arrays although I think they will 
be useful for me. I should also explore how to create custom color maps.

 
 Your suggestions are really appreciated :) And wish me good luck!
 

I was going to! Good luck, I hope you manage to take this project to 
completion.

João Silva


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


Re: [Matplotlib-users] Removing buttons from the toolbar in MPL backends

2009-01-05 Thread John Hunter
On Mon, Jan 5, 2009 at 1:56 PM, Mauro Cavalcanti mauro...@gmail.com wrote:
 Dear ALL,

 Is there any way to exclude (ie., make invlsible) one or more of the
 standard buttons which appear on the toolbar (either the Classic or
 the Toolbar2) of the MPL backends?

 Thanks in advance for any assistance you can provide!

There are some examples using a custom toolbar which depends on which
user interface you are using (there is no API for customizing from
withing pylab/pyplot but it is on the wishlist to have a toolbar
customization/extension API)

See for example
http://matplotlib.sourceforge.net/examples/user_interfaces/embedding_in_wx4.html?highlight=codex%20custom%20toolbar

In this example a button is added to the default toolbar.  You could
copy the toolbar code out of the backend and remove the things you do
not want and then add new buttons, etc.

JDH

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


Re: [Matplotlib-users] What would you like to see in a book about Matplotlib?

2009-01-05 Thread Sandro Tosi
Hello João,
thanks for replying

On Mon, Jan 5, 2009 at 13:40, João Luís Silva jsi...@fc.up.pt wrote:
 Sandro Tosi wrote:
 - what are the (basic) things that, when you were beginning to use
 matplotlib, you wanted to see grouped up but couldn't find?

 I don't know if you consider it basic or not, but I would have liked
 better documentation of the object oriented interface (matplotlib). The

could you be a little more specific on what you mean here?

 - what would you like to see in a book about matplotlib?

 As above, at least a chapter about the object oriented interface showing
 how to embed matplotlib on a application, and outlining the structure of
 the OO interface.

Well, this is part of the purpose of the book: show how to embed mpl
in applications.

 - what are some those advanced feature that made you yell WOW!! ?

 I haven't really used matplotlib's advanced features. There are some
 that I like, such as automatic legend placement and mathtext support.

mathtext and latex support will be in the advanced features section

 The number of supported backends is impressive just by itself, making
 matplotlib much more useful. There are some little things such as the
 search order for the matplotlibrc file that make it possible to specify
  different settings for a given directory.

There will be a part even on configuration (of course :) ).

 - what are the things you'd like to explore of matplotlib and never
 had time to do?

 I never had the time to try the masked arrays although I think they will
 be useful for me. I should also explore how to create custom color maps.

2 points added to the adv featues list (in part because something was
already there, in a different form).

 Your suggestions are really appreciated :) And wish me good luck!

 I was going to! Good luck, I hope you manage to take this project to
 completion.

Eheh, thanks! I really hope I'll be able to handle even this task :)

Cheers,
-- 
Sandro Tosi (aka morph, morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi

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


Re: [Matplotlib-users] [matplotlib-devel] What would you like to see in a book about Matplotlib?

2009-01-05 Thread Sandro Tosi
Hello Andrew,
thanks for taking the time to reply.

First of all, let me clarify that I received a proposal (and not the
opposite) so some decision were already made about the book format.

On Mon, Jan 5, 2009 at 20:00, Andrew Straw straw...@astraw.com wrote:
 Hi Sandro,

 It's great news that a book may come out on MPL.

 Speaking as an aspiring university professor in neuroscience, I would
 like to see something that could be used as a resource for undergraduate
 students just learning Python and MPL.

The cut of the book is for already experienced Python programmers. For
sure, in the approaching chapter to mpl, I won't go too much into
deep of python programming, and I suppose they'll be easy to read even
for new comers.

 Due to this perspective, I think
 such a book would cover both numpy and MPL. The emphasis could clearly
 by on MPL, but basic numpy idioms and concepts should also be taught.

Mh, the focus the editor would like to see is about introducing mpl +
integrating into apps. The examples I have in mind for the pratical
part of apps integration already cointains some sort of introduction
to gather data and plot them (but I can't go to much on the scientific
side :) ). I will propose a chapter like Matplotlib for the science
and here your suggestion on what you'd like to see there is welcome.

 I
 think an example-driven approach would be very useful -- something like
 an undergraduate laboratory experiment where students measure and plot
 raw values and compute histograms and statistics (e.g. mean and std).
 More advanced sections might perform statistical comparisons of
 different treatments (e.g. using chi squared, KS and/or T tests), do
 linear least squares fitting (with np.linalg.lstsq), and possibly
 non-linear curve fitting using something like scipy.optimize.fmin.

That could be a beginning of that chapter contents: more more more ideas :)

 That's my self-serving $0.02, since you asked! :)

And they are very much welcome!!

 You may also want to speak with John Hunter and Fernando Perez about the
 possibility of collaborating -- they've already done some work towards a
 book, too.

I'm sure be happy to hear their voice on this product, but (given the
preamble) I don't know if the editor would be fine with co-authorship;
I'll ask, just to be sure.

Cheers,
-- 
Sandro Tosi (aka morph, morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi

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


Re: [Matplotlib-users] [matplotlib-devel] What would you like to see in a book about Matplotlib?

2009-01-05 Thread Christopher Barker
Sandro Tosi wrote:
 The idea of the book is to start with simple plots, describing the
 methods we call and how they work, to go into more details along the
 book.

I suggest that you focus on the OO interface, rather than the pylab 
interface from the beginning. This will ease the transition from command 
line use to embedding, help folks understand the structure of MPL, and 
is the right way to do it (IMHO) with an OO  language anyway.

-Chris



-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/ORR(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

chris.bar...@noaa.gov

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


Re: [Matplotlib-users] [matplotlib-devel] What would you like to see in a book about Matplotlib?

2009-01-05 Thread Sandro Tosi
On Tue, Jan 6, 2009 at 00:20, Christopher Barker chris.bar...@noaa.gov wrote:
 Sandro Tosi wrote:

 The idea of the book is to start with simple plots, describing the
 methods we call and how they work, to go into more details along the
 book.

 I suggest that you focus on the OO interface, rather than the pylab
 interface from the beginning. This will ease the transition from command
 line use to embedding, help folks understand the structure of MPL, and is
 the right way to do it (IMHO) with an OO  language anyway.

So you suggest to start from matplotlib.pyplot and not from pylab?
Well, sure it's an interesting point-of-view. I'll reflect about your
proposal.

Thanks!!

-- 
Sandro Tosi (aka morph, morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi

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


Re: [Matplotlib-users] [matplotlib-devel] What would you like to see in a book about Matplotlib?

2009-01-05 Thread Christopher Barker
Sandro Tosi wrote:
 So you suggest to start from matplotlib.pyplot and not from pylab?

actually, I think matpoltlib.pyplot still has all of pylab in it, just 
not all of numpy also. So yes, do that, but what I meant was to focus on 
using the OO interface, rather than the state machine interface:

rather than 'gca', 'gcf', etc, store references to the figures and axis, 
etc:

this kind of thing:

fig = plt.Figure()

ax = fig.add_subplot(111)
ax.plot([1,2,3])

ax.set_title('hi mom')

ax.grid(True)

ax.set_xlabel('time')
ax.set_ylabel('volts')

While we are at it, discourage the use of import * !

-Chris







-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/ORR(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

chris.bar...@noaa.gov

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


Re: [Matplotlib-users] [matplotlib-devel] What would you like to see in a book about Matplotlib?

2009-01-05 Thread Sandro Tosi
On Tue, Jan 6, 2009 at 01:48, Christopher Barker chris.bar...@noaa.gov wrote:
 Sandro Tosi wrote:

 So you suggest to start from matplotlib.pyplot and not from pylab?

 actually, I think matpoltlib.pyplot still has all of pylab in it, just not
 all of numpy also.

yes, pylab glues pyplot and numpy together

 So yes, do that, but what I meant was to focus on using
 the OO interface, rather than the state machine interface:

 rather than 'gca', 'gcf', etc, store references to the figures and axis,
 etc:

 this kind of thing:

 fig = plt.Figure()

 ax = fig.add_subplot(111)
 ax.plot([1,2,3])

 ax.set_title('hi mom')

 ax.grid(True)

 ax.set_xlabel('time')
 ax.set_ylabel('volts')

Ahhh ok, now I got it: I always use the style above, so I didn't know
the difference :) A reference to the doc is:
http://matplotlib.sourceforge.net/faq/usage_faq.html

 While we are at it, discourage the use of import * !

Absolutely!

Your suggestions were really precious: please don't stop the stream,
it anything comes up :)

Cheers,
-- 
Sandro Tosi (aka morph, morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi

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