## matplotlib-users

 [Matplotlib-users] another reason 'shape' shouldn't exist for pcolor plots?!... From: - 2005-01-13 16:57:34 As you know you must set 'shape' attribute of your coordinate arrays used to generate a pcolor plot. Imagine your arrays had points (Cartesian position vectors) all over the place at completely random points in space. The 'shape' of this plot depends on max and min values of each coordinate. I believe Mathematica plotting would automagically calculate these max and min values and set plot ranges for you. This is why 'shape' attribute of Matplotlib/Numarray seems awkward and unnecessary to me unless I'm missing something. You should not have ability to set 'shape' your self. It seems it wouldn't make any sense to *change* the shape since that is decided by range of your values already. Chris -- _______________________________________ Christian Seberino, Ph.D. SPAWAR Systems Center San Diego Code 2872 49258 Mills Street, Room 158 San Diego, CA 92152-5385 U.S.A. Phone: (619) 553-9973 Fax : (619) 553-6521 Email: seberino@... _______________________________________ 
 Re: [Matplotlib-users] another reason 'shape' shouldn't exist for pcolor plots?!... From: John Hunter - 2005-01-14 17:12:43 >>>>> "seberino" == seberino writes: seberino> Imagine your arrays had points (Cartesian position seberino> vectors) all over the place at completely random points seberino> in space. The 'shape' of this plot depends on max and seberino> min values of each coordinate. I believe Mathematica seberino> plotting would automagically calculate these max and min seberino> values and set plot ranges for you. This is why 'shape' seberino> attribute of Matplotlib/Numarray seems awkward and seberino> unnecessary to me unless I'm missing something. There are a variety of issues here. - The "shape" attribute comes form Numeric/numarray and is outside the realm of matplotlib. matplotlib plots numerix arrays. - The pcolor interface is determined by matlab. matlab has a pcolor function which I have tried to implement faithfully. To the extent that matplotlib has been successful, this is due in part because matlab has a good interface for plotting and replicating it generally, is a good thing. - Storing the "shape" of a data set allows for memory and efficiency savings. To take your example of a set of x,y,z points, you are right you cold reconstruct rectilinear grid from this data -- one might have to use interpolation but it can be done -- but it would require a lot of unnecessary computation for data which already lives on a grid. So pcolor assumes your data are on a rectilinear grid and it is incumbent upon you to get it into that form. The meshgrid function takes regularly sampled vector data and turns it into a rectilinear grid (this is also a matlab function). The matlab griddata function (which is not yet implemented in matplotlib) does the same for irregularly sampled data. JDH 
 [Matplotlib-users] User guide production?? From: Gary - 2005-01-14 19:59:14 John, I've been meaning to ask you ... how did you produce the very fine User Guide? Is that TeXmacs? LyX? raw LaTeX? ConTeXt? emacs magic? Is there some slick way of getting the listings from the command line window into the document, especially with the comments colorized? I'm writing a small local guide, and was wondering ... -gary 
 Re: [Matplotlib-users] User guide production?? From: John Hunter - 2005-01-15 16:49:36 >>>>> "Gary" == Gary writes: Gary> John, I've been meaning to ask you ... how did you produce Gary> the very fine User Guide? Is that TeXmacs? LyX? raw Gary> LaTeX? ConTeXt? emacs magic? I'm using latex with the excellent listings package- http://www.atscire.de/index.php?nav=products/listings. It knows python syntax, and can do string, comment, keyword highlighting and more. You can see the latex src that created the user's guide by checking out users_guide from matplotlib CVS, or visiting http://cvs.sourceforge.net/viewcvs.py/matplotlib/users_guide . The README file in that directory contains more information. For much of the user's guide, I keep the python code in external files and include them in a special verbatim environment that does syntax highlighting with , eg \lstinputlisting[linerange=1-12,caption={Wild and wonderful ways to specify colors; see Figure~\ref{fig:color_demo}}, label=lst:color_demo]{code/color_demo.py} The linerange is used to leave some boilerplate at the beginning and end of the file (eg some savefig calls to generate the accompanying figures in eps and png). This helps insure that the python code in the manual actually runs, since it is the same code used to generate the figures for the guide. Gary> Is there some slick way of getting the listings from the Gary> command line window into the document, especially with the Gary> comments colorized? I'm writing a small local guide, and Gary> was wondering ... By "the command line window" do you mean the python shell? If so, you'll have to do some special tweaks to handle the >>> prompt, but the listings packages is very sophisticated, and can ignore prefixes or add them, etc.... There is a fairly comprehensive manual. Or did you mean something else? JDH 
 Re[2]: [Matplotlib-users] User guide production?? From: Alan G Isaac - 2005-01-15 17:42:59 On Sat, 15 Jan 2005, John Hunter apparently wrote: > I'm using latex with the excellent listings package- > http://www.atscire.de/index.php?nav=products/listings. It knows > python syntax, and can do string, comment, keyword highlighting and > more. Did you make full matplotlib and/or scipy language definitions? If so, are they available? Alan Isaac PS I found this list in the docs, which is of course part of the answer to my question. {axes, axis, bar, cla, clf, clim, close, cohere, colorbar, colors, csd, draw, errorbar, figimage, figlegend, figtext, figure, fill, gca, gcf, gci, get, get_current_fig_manager, get_plot_commands, gray, grid, hist, hlines, hold, imshow, jet, legend, load, loglog, pcolor, pcolor_classic, plot, plot_date, plotting, psd, raise_msg_to_str, rc, rcdefaults, save, savefig, scatter, scatter_classic, semilogx, semilogy, set, specgram, stem, subplot, table, text, title, vlines, xlabel, ylabel}, 
 Re: [Matplotlib-users] User guide production?? From: John Hunter - 2005-01-15 20:00:34 >>>>> "Alan" == Alan G Isaac writes: Alan> Did you make full matplotlib and/or scipy language Alan> definitions? If so, are they available? Alan Isaac I did, as you found in your PS, but I choose not to emphasize them because I found all the extra color distracting. So I made the emph color "black", ie the same as the color of plain text, but left the wordlist there in case I changed my mind emphstyle = \color{black}, % color for matplotlib funcs What do you think? Would it be useful to colorize the matplotlib functions in the guide? JDH