Re: [Matplotlib-users] hexbin log bins and colorbar

2010-02-22 Thread Jan Strube
Hi John, Eric,

sorry to bug again, but was either of you able to reproduce my findings that
in svn head the tick labels don't get printed if the formatter changes them
to be outside the range of the axis?
Cheers,
Jan


On Fri, Feb 19, 2010 at 10:40 AM, Jan Strube curious...@gmail.com wrote:

 Hi John,

 I am now at r8141.
 I don't see a difference. There's a one at the bottom of the scale, that's
 all.
 I am copying and pasting the code in your other email into a python
 console.

 It's a bit strange, because when I put in a print statement, I see that the
 method gets called a number of times...
 [edit] I see what's going on. If I replace vv with a large constant (like
 100), it never gets printed.
 If I replace vv with a small constant (like 1), that is below the range of
 the scale, it does get printed at each tick.[/edit]

 My setup is kubuntu karmic, dependencies listed below.
 I have removed my matplotlibrc, but the result is the same. I am attaching
 it nevertheless...

 Cheers,
 Jan



 

 BUILDING
 MATPLOTLIB

 matplotlib:
 1.0.svn

 python: 2.6.4 (r264:75706, Nov  2 2009, 14:44:17)
 [GCC

 4.4.1]

   platform:
 linux2



 REQUIRED
 DEPENDENCIES

  numpy:
 1.3.0

  freetype2:
 9.20.3



 OPTIONAL BACKEND
 DEPENDENCIES

 libpng:
 1.2.37

Tkinter:
 no

 * TKAgg requires
 Tkinter

   wxPython:
 no

 * wxPython not
 found

 pkg-config: looking for pygtk-2.0
 gtk+-2.0

 * Package pygtk-2.0 was not found in the
 pkg-config
 * search path. Perhaps you should add the
 directory
 * containing `pygtk-2.0.pc' to the
 PKG_CONFIG_PATH

 * environment variable No package 'pygtk-2.0'
 found
 * Package gtk+-2.0 was not found in the
 pkg-config
 * search path. Perhaps you should add the
 directory
 * containing `gtk+-2.0.pc' to the
 PKG_CONFIG_PATH

 * environment variable No package 'gtk+-2.0'
 found
 * You may need to install 'dev' package(s)
 to
 * provide header
 files.

   Gtk+:
 no

 * Could not find Gtk+ headers in any
 of

 * '/usr/local/include', '/usr/include',
 '.'
Mac OS X native:
 no

 Qt:
 no

Qt4: Qt: 4.5.2, PyQt4:
 4.6

  Cairo:
 1.8.6



 OPTIONAL DATE/TIMEZONE
 DEPENDENCIES

   datetime: present, version
 unknown

   dateutil:
 1.4.1

   pytz:
 2009l



 OPTIONAL USETEX
 DEPENDENCIES

 dvipng:
 1.12

ghostscript:
 8.70

  latex:
 3.1415926

pdftops:
 0.12.0



 [Edit setup.cfg to suppress the above
 messages]


 


 On Thu, Feb 18, 2010 at 10:29 PM, John Hunter jdh2...@gmail.com wrote:

 On Thu, Feb 18, 2010 at 4:06 PM, Jan Strube curious...@gmail.com wrote:
  Hi John,
  thanks for trying this also. Yes, I think it's a bug that not the scale
 is
  log, but the data is.
  Unfortunately, the solution really doesn't work for me.
  Please see the attached screenshot. (Yes, it still says log_10 entries,
 but
  the code is otherwise the same)
  In [2]: matplotlib.__version__
  Out[2]: '1.0.svn'
  This is r8063, I think.
  Strange that I get different results. Could this be a backend problem? I
 use
  PyQT4.
  I'd be happy to also update from svn if you think that helps.

 I'm running svn but not svn HEAD -- you should try updating to HEAD
 and I will do the same later (unfortunately HEAD is broken on my work
 machine (solaris, python2.4) because of the CXX upgrade I put in some
 time ago.  I think I am on r8083.

 I do not think this difference could be caused by a backend or GUI
 version difference as all of the formatting logic happens in the
 frontend.  If we are on the same version of svn, we should be getting
 the same tick labels.

 JDH



--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net

[Matplotlib-users] dropdown menu

2010-02-22 Thread Wolfgang Kerzendorf
Hello,

Now that I have found the awesome widgets in matplotlib I want more: dropdown 
menus? will that come at some stage?

Cheers
Wolfgang
--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] dropdown menu

2010-02-22 Thread John Hunter
On Mon, Feb 22, 2010 at 4:26 AM, Wolfgang Kerzendorf
wkerz...@mso.anu.edu.au wrote:
 Hello,

 Now that I have found the awesome widgets in matplotlib I want more: dropdown 
 menus? will that come at some stage?

I have worked on it, but not finished it.  I put the code in svn under examples

  http://matplotlib.sourceforge.net/examples/widgets/menu.html

but it would be migrated to matplotlib.widgets once it is completed.
If you or someone else wants to run with it, that would be great.  It
would be handy to have this functionality.

I wrote this before JJ provided his nice containers in offsetbox, and
it should probably be reworked to use the OffsetbOX

JDH

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] label not print theta symbol

2010-02-22 Thread Philipp Bender
Hi,

 How do I print as label of an axis the Theta symbol - θ?

you can take a look in the docs, there are examples how to use LaTeX for the 
labels. You get the letter in LaTeX with \theta or \Theta.

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] label not print theta symbol

2010-02-22 Thread Darren Dale
On Mon, Feb 22, 2010 at 8:36 AM, Philipp Bender li...@rootiniert.de wrote:
 Hi,

 How do I print as label of an axis the Theta symbol - θ?

 you can take a look in the docs, there are examples how to use LaTeX for the
 labels. You get the letter in LaTeX with \theta or \Theta.

But be sure to either use raw strings or escape properly: r\theta or \\theta

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] label not print theta symbol

2010-02-22 Thread Samuel Teixeira Santos
thanks both!
very nice LaTeX

2010/2/22 Darren Dale dsdal...@gmail.com

 On Mon, Feb 22, 2010 at 8:36 AM, Philipp Bender li...@rootiniert.de
 wrote:
  Hi,
 
  How do I print as label of an axis the Theta symbol - θ?
 
  you can take a look in the docs, there are examples how to use LaTeX for
 the
  labels. You get the letter in LaTeX with \theta or \Theta.

 But be sure to either use raw strings or escape properly: r\theta or
 \\theta


 --
 Download Intel#174; Parallel Studio Eval
 Try the new software tools for yourself. Speed compiling, find bugs
 proactively, and fine-tune applications for parallel performance.
 See why Intel Parallel Studio got high marks during beta.
 http://p.sf.net/sfu/intel-sw-dev
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] 101 Point Segmentation Fault

2010-02-22 Thread Michael Droettboom
Can you provide a gdb backtrace?

Run gdb python, then at the gdb prompt type run -c 'import pylab; 
pylab.clf(); pylab.plot(pylab.sin(range(101))); pylab.xlabel(Test X); 
pylab.ylabel(Test Y); pylab.show()'.  After it segfaults, type bt 
to get a backtrace, and copy-and-paste it to this list.

Mike

Joseph D Cali wrote:
 I am encountering the following error:

 python -c 'import pylab; pylab.clf(); pylab.plot(pylab.sin(range(101)));
 pylab.xlabel(Test X); pylab.ylabel(Test Y); pylab.show()'

 /local_home/calijos/usr/lib/python2.6/site-packages/matplotlib/backends/backend_gtk.py:621:
  DeprecationWarning: Use the new widget gtk.Tooltip
   self.tooltips = gtk.Tooltips()
 Segmentation fault

 -

 But when I run the following command, I encounter no errors and plot is
 as expected:

 python -c 'import pylab; pylab.clf(); pylab.plot(pylab.sin(range(100)));
 pylab.xlabel(Test X); pylab.ylabel(Test Y); pylab.show()'

 I tried several other plots, any plots with less than 100 points work
 correctly, any plots with more than 100 points segfault.

 -

 My current system setup is:

 System: Ubuntu 9.04 x64
 Python: Python 2.6.2
 Matplotlib: 0.99.1 (tied 0.99.1.1, 0.99.1.2, and latest SVN version:
 8126)
 Numpy Version: 1.5.0.dev8106

 I have been a long time Matplotlib user, and have never encountered this
 issue.  It started whenever I updated numpy and scipy.  However,
 reverting to the old version does not seem to fix the situation.  I also
 cannot get numpy to crash on its own.  All my software works when
 plotting is disabled.

 Has anyone else experienced this or similar problems during an upgrade?

 Joe



 --
 SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
 Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
 http://p.sf.net/sfu/solaris-dev2dev
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users
   

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


--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Interpolation between points during plot()

2010-02-22 Thread Michael Droettboom
The drawing between the points is done using the regular line drawing 
commands of the backend.  So there isn't really any low-level control 
over how the line between points is drawn.

As a workaround, however, you can interpolate the data yourself and just 
pass more points to matplotlib.  You may also be interested in this 
document if you're implementing new geodesics (though it doesn't solve 
the interpolation problem you describe):

http://matplotlib.sourceforge.net/devel/add_new_projection.html

Mike

T J wrote:
 Hi,

 When plotting,

 plot(x, y, marker=-)

 and its similar markers, what functionality in MPL is responsible for
 interpolating between the points?  My naive guess is that
 interpolation is done in display coordinates since everything looks
 nice even when zooming in.I inquire because I'd like to make
 interpolation between two points follow some other path between the
 two points.  In other words, I'd like to make a plot structure which
 will follow a different type of geodesic.  Any tips or pointers in the
 right direction would be greatly appreciated.

 Thanks!

 --
 SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
 Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
 http://p.sf.net/sfu/solaris-dev2dev
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users
   

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


--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Pydot graphs in matplotlib?

2010-02-22 Thread Michael Droettboom
Erik Tollerud wrote:
 I'm curious if anyone knows a good way to embed pydot
 (http://code.google.com/p/pydot/) graphs (or really, any
 graphviz-style graphs) inside matplotlib somehow.  I could easily
 write out a png or something from pydot and then imshow it, but that
 seems very kludgy.  Is there some way to load svg or other vector data
 into matplotlib to be shown inside a figure?
Unfortunately not.  It is possible to cut-and-paste graphviz SVG into a 
matplotlib SVG using Inkscape, but that's fairly kludgy also and can't 
be automated.

It would be nice to have a graphviz importer for matplotlib (something 
that would convert a dot stream to matplotlib artists), but that's a 
mid-sized development effort...  It wouldn't consider it extremely 
difficult, but it would need someone to step up to implement it.

Mike

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


--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Graph gains a blank space at the right hand side

2010-02-22 Thread Geoff Bache
Hi all,

I'm having some trouble with graphs ending up wider than I'd like. I'm
using matplotlib 0.98.5.2. If I do as follows:

import pylab
pylab.clf()
figure2 = pylab.figure(1)
axessubplot2 = pylab.subplot(111)
axessubplot2.fill_between([0, 1, 2, 3, 4, 5, 6], [0, 0, 0, 0, 0, 0,
0], [1, 1, 1, 1, 1, 0, 1], color='green')
axessubplot2.fill_between([4, 5, 6], [1, 0, 1], [1, 1, 1], color='red')
figure2.savefig('graph.png', dpi=100)

then the X-axis of the graph goes up to 7 and I get a white region at
the right-hand side, even though none of my calls have provided any
values for x6. If I for example eliminate the first point and instead
do

import pylab
pylab.clf()
figure2 = pylab.figure(1)
axessubplot2 = pylab.subplot(111)
axessubplot2.fill_between([0, 1, 2, 3, 4, 5], [0, 0, 0, 0, 0, 0], [1,
1, 1, 1, 0, 1], color='green')
axessubplot2.fill_between([3, 4, 5], [1, 0, 1], [1, 1, 1], color='red')
figure2.savefig('graph.png', dpi=100)

then all is well and I don't get such a region.

So I guess I have two questions.
1) Is this a bug? It certainly feels like one...
2) Is there a workaround / what should I do instead?

Regards,
Geoff Bache

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Clipping

2010-02-22 Thread Michael Droettboom
The coordinates for Circle (and all patches) are in data coordinates.  
So the (300, 300) is relative to the values in the data itself.  When 
adding a patch directly to a plot, however, the limits may not 
automatically update, so you may need to call axes.set_xlim or 
axes.set_ylim to adjust them to make the circle visible.

Mike

Ryan May wrote:
 On Wed, Feb 17, 2010 at 6:44 PM, David Arnold dwarnol...@suddenlink.net 
 wrote:
   
 All,

 I'm looking at:

 http://matplotlib.sourceforge.net/examples/api/clippath_demo.html

 But I cannot figure out:

 patch=patches.Circle((300, 300), radius=100)

 Where precisely is (300,300)?
 

 I believe it's in window coordinates (pixels), with 0,0 being the lower left.

 Ryan

   

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


--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] 101 Point Segmentation Fault

2010-02-22 Thread Joseph D Cali
I will be sure to use gdb and bt to get that information next time I
encounter the segmentation fault or any other error that I post to
list.  

I tried going back to the numpy.dev8106 version just now in an attempt
to recreate the conditions of the error, but I was unsuccessful in
generating any segmentation faults.  My guess is that I made some novice
mistake when upgrading the libraries from source.  

On Mon, 2010-02-22 at 10:16 -0500, Michael Droettboom wrote:
 Can you provide a gdb backtrace?
 
 Run gdb python, then at the gdb prompt type run -c 'import pylab; 
 pylab.clf(); pylab.plot(pylab.sin(range(101))); pylab.xlabel(Test X); 
 pylab.ylabel(Test Y); pylab.show()'.  After it segfaults, type bt 
 to get a backtrace, and copy-and-paste it to this list.
 
 Mike
 
 Joseph D Cali wrote:
  I am encountering the following error:
 
  python -c 'import pylab; pylab.clf(); pylab.plot(pylab.sin(range(101)));
  pylab.xlabel(Test X); pylab.ylabel(Test Y); pylab.show()'
 
  /local_home/calijos/usr/lib/python2.6/site-packages/matplotlib/backends/backend_gtk.py:621:
   DeprecationWarning: Use the new widget gtk.Tooltip
self.tooltips = gtk.Tooltips()
  Segmentation fault
 
  -
 
  But when I run the following command, I encounter no errors and plot is
  as expected:
 
  python -c 'import pylab; pylab.clf(); pylab.plot(pylab.sin(range(100)));
  pylab.xlabel(Test X); pylab.ylabel(Test Y); pylab.show()'
 
  I tried several other plots, any plots with less than 100 points work
  correctly, any plots with more than 100 points segfault.
 
  -
 
  My current system setup is:
 
  System: Ubuntu 9.04 x64
  Python: Python 2.6.2
  Matplotlib: 0.99.1 (tied 0.99.1.1, 0.99.1.2, and latest SVN version:
  8126)
  Numpy Version: 1.5.0.dev8106
 
  I have been a long time Matplotlib user, and have never encountered this
  issue.  It started whenever I updated numpy and scipy.  However,
  reverting to the old version does not seem to fix the situation.  I also
  cannot get numpy to crash on its own.  All my software works when
  plotting is disabled.
 
  Has anyone else experienced this or similar problems during an upgrade?
 
  Joe
 
 
 
  --
  SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
  Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
  http://p.sf.net/sfu/solaris-dev2dev
  ___
  Matplotlib-users mailing list
  Matplotlib-users@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/matplotlib-users

 
-- 
Sincerely,
Joe


--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] mplot3d stays?

2010-02-22 Thread John Hunter
On Mon, Feb 22, 2010 at 10:01 AM, Ben Axelrod baxel...@coroware.com wrote:
 John, your assesment of the problem is correct.  And I believe your suggested 
 solution is also correct.  Currently, each call to a mplot3d plot method is 
 treated independantly.  They get converted into custom PolyCollections which 
 each do the Z-order sorting.


 There is still an issue here however.  Even if we implement the aformentioned 
 solution, we are still only approximating a 3d library.  And the result will 
 still not be as nice as matlab.  I believe that because we treat the surface 
 as a series of 2D polygons, the intersection between two surfaces will be at 
 the polygon edges.  See the attached image for an example of what the 
 intersection between a sphere and plane might look like.

True enough, but as your example shows it would still be a substantial
improvement over what we have now, and by getting all the faces in the
scene into a single data structure, we leave open the possibility of
doing something more sophisticated down the road (like chopping a
problematic face into multiple faces, some in front, some behind, an
intersecting object).

JDH

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Clipping

2010-02-22 Thread John Hunter
On Mon, Feb 22, 2010 at 10:11 AM, Michael Droettboom md...@stsci.edu wrote:
 The coordinates for Circle (and all patches) are in data coordinates.
 So the (300, 300) is relative to the values in the data itself.  When
 adding a patch directly to a plot, however, the limits may not
 automatically update, so you may need to call axes.set_xlim or
 axes.set_ylim to adjust them to make the circle visible.

In this example, though, he is not adding the Circle to the Axes via
add_patch (so the transData transform is not set).

Rather, he is using it to set the clip path

  http://matplotlib.sourceforge.net/examples/api/clippath_demo.html

So I think Ryan's answer is correct.

But David, if you want the clippath to be in data coordinates, you can
set the transform yourself

  patch = patches.Circle((300,300), radius=100, transform=ax.transData)

See the transformations tutorial for more about the coordinate systems
and transformations

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

JDH

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] missing module docs

2010-02-22 Thread Ben Axelrod
I noticed that there are many modules in the current code base that are not 
listed at: http://matplotlib.sourceforge.net/modindex.html.  I understand that 
a few are new files and that the documentation for these will be generated 
during the next release.  But I know that most of these were in the last 
release so should have had their documentation generated.  Am I missing 
something?  Can the documentation for these modules be found somewhere else?

bezier
blocking_input
contour
docstring
finance
hatch
image
mlab
mpl
offsetbox
patheffects
pylab
pyparsing
quiver
rcsetup
table
texmanager
textpath
tight_bbox
units
widgets
windowing
Thanks,
-Ben


Ben Axelrod
Robotics Engineer
(800) 641-2676 x737
[cid:281553619@22022010-0FB8]
www.coroware.comhttp://www.coroware.com/
www.corobot.nethttp://www.corobot.net/

inline: image002.gif--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] missing module docs

2010-02-22 Thread John Hunter
On Mon, Feb 22, 2010 at 1:44 PM, Ben Axelrod baxel...@coroware.com wrote:

  I noticed that there are many modules in the current code base that are
 not listed at: http://matplotlib.sourceforge.net/modindex.html.  I
 understand that a few are new files and that the documentation for these
 will be generated during the next release.  But I know that most of these
 were in the last release so should have had their documentation generated.
 Am I missing something?  Can the documentation for these modules be found
 somewhere else?


You're not missing anything in terms of the html/pdf docs.  When we
converted our documentation build system to sphinx/rest, we had to convert
our docstrings to rest as well.  We made good headway for a while but the
progress has stalled.  To add a module to the documentation system, you need
to

  * make sure the docstrings are ReST compliant

  * add a stub in doc/api (eg see figure_api.rst

  * add your new rst file to doc/api/index.rst

We'd like to see all of the user facing modules converted, so contributions
are welcome.  See also


http://matplotlib.sourceforge.net/faq/howto_faq.html?highlight=contributing#contribute-to-matplotlib-documentation
  http://matplotlib.sourceforge.net/devel/documenting_mpl.html
  http://matplotlib.sourceforge.net/sampledoc/

In the meantime, you can always use pydoc or help from the interactive
shell, eg::

   pydoc matplotlib.patheffects

pydoc also has flags for generating html, etc.

or from the shell (ipython here)::


  In [3]: import matplotlib.patheffects

  In [4]: help matplotlib.patheffects
  -- help(matplotlib.patheffects)

JDH
--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] hexbin log bins and colorbar

2010-02-22 Thread John Hunter
On Mon, Feb 22, 2010 at 3:42 PM, Jan Strube curious...@gmail.com wrote:
 Hi John,
 the attachment may not make it to the list. However, please run the modified
 test.py that I have attached.
 It requires the attached input file.
 Then change it to read the original input file.
 In my case:
 The broken case:

OK, at least now we are running the sample example :-)

The problem is that the LogFormatter has a default which is
decadeOnly=True and in the first case which worked three of the
tick locations coincidentally came down on decades (0, 1, 2 - 1, 10,
100).  In the case you were working with, only one of the ticks mapped
to the decade.

So for this case we want a locator that returns integers 0,1,2... that
will then get mapped via Eric's custom formatter to the 10^i formats.
Unfortunately, there is no easy way to set the locator for the
colorbar.  An easy workaround *for this case* is to simply set the
tick locations

  cb = plt.colorbar(format=LogFormatterHB(), ticks=[0,1,2])

but in general you may not know the decade span that you need.  It
does all feel a bit kludgy.  The problem as you noted in one of your
earlier posts is that the data is log scaled before being passed into
the PolyCollection and the fact that it is log scaled is then lost to
the colorbar.  It seems everything would fit together more naturally
if we passed in raw scalar data to the PolyCollection and set the norm
to be colors.LogNorm, and then also set norm=colors.LogNorm on the
colorbar

I tried:

  polycol = plt.hexbin(data['jetMomentum'][cut] / 1000,
data['deltaR'][cut],gridsize=50, norm=colors.LogNorm())
  cb = plt.colorbar(norm=colors.LogNorm())

but this appears to be broken:

msie...@pinchiepie:Downloads python test.py
Traceback (most recent call last):
  File test.py, line 29, in module
cb = plt.colorbar()
  File /home/msierig/dev/lib/python2.6/site-packages/matplotlib/pyplot.py,
line 1356, in colorbar
ret = gcf().colorbar(mappable, cax = cax, ax=ax, **kw)
  File /home/msierig/dev/lib/python2.6/site-packages/matplotlib/figure.py,
line 1103, in colorbar
cb = cbar.Colorbar(cax, mappable, **kw)
  File /home/msierig/dev/lib/python2.6/site-packages/matplotlib/colorbar.py,
line 690, in __init__
ColorbarBase.__init__(self, ax, **kw)
  File /home/msierig/dev/lib/python2.6/site-packages/matplotlib/colorbar.py,
line 242, in __init__
self.draw_all()
  File /home/msierig/dev/lib/python2.6/site-packages/matplotlib/colorbar.py,
line 260, in draw_all
self._config_axes(X, Y)
  File /home/msierig/dev/lib/python2.6/site-packages/matplotlib/colorbar.py,
line 332, in _config_axes
self.update_ticks()
  File /home/msierig/dev/lib/python2.6/site-packages/matplotlib/colorbar.py,
line 271, in update_ticks
ticks, ticklabels, offset_string = self._ticker()
  File /home/msierig/dev/lib/python2.6/site-packages/matplotlib/colorbar.py,
line 458, in _ticker
b = np.array(locator())
  File /home/msierig/dev/lib/python2.6/site-packages/matplotlib/ticker.py,
line 1173, in __call__
vmin = self.axis.get_minpos()

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] hexbin log bins and colorbar

2010-02-22 Thread John Hunter
On Mon, Feb 22, 2010 at 4:33 PM, John Hunter jdh2...@gmail.com wrote:
  polycol = plt.hexbin(data['jetMomentum'][cut] / 1000,
 data['deltaR'][cut],gridsize=50, norm=colors.LogNorm())
  cb = plt.colorbar(norm=colors.LogNorm())

 but this appears to be broken:

I committed some changes to support this -- the following now works:

  polycol = plt.hexbin(data['jetMomentum'][cut] / 1000,
data['deltaR'][cut],gridsize=50, norm=colors.LogNorm())

  cb = plt.colorbar(norm=polycol.norm)

Eric - I was surprised the colorbar does not use the mappable norm by
default (if passed norm=None).  Instead it uses ::

  norm = colors.Normalize()

is this a feature?

JDH

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] hexbin log bins and colorbar

2010-02-22 Thread Eric Firing
John Hunter wrote:
 On Mon, Feb 22, 2010 at 4:33 PM, John Hunter jdh2...@gmail.com wrote:
  polycol = plt.hexbin(data['jetMomentum'][cut] / 1000,
 data['deltaR'][cut],gridsize=50, norm=colors.LogNorm())
  cb = plt.colorbar(norm=colors.LogNorm())

 but this appears to be broken:
 
 I committed some changes to support this -- the following now works:
 
   polycol = plt.hexbin(data['jetMomentum'][cut] / 1000,
 data['deltaR'][cut],gridsize=50, norm=colors.LogNorm())
 
   cb = plt.colorbar(norm=polycol.norm)
 
 Eric - I was surprised the colorbar does not use the mappable norm by
 default (if passed norm=None).  Instead it uses ::
 
   norm = colors.Normalize()
 
 is this a feature?

Yes.  You are looking at ColorbarBase, which does not have an associated 
mappable.  The derived Colorbar class does grab the cmap and norm from 
the mappable used in the initialization.  Is this somehow not working? 
Did you really need to specify the norm explicitly?

Eric
 
 JDH


--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] How to control display precision and style (e.g., %f or %e) of axis tick labels?

2010-02-22 Thread David Goldsmith
I've searched and searched the online docs...please help.

DG


  

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] How to control display precision and style (e.g., %f or %e) of axis tick labels?

2010-02-22 Thread Philipp Bender
Hi David,

I found this one::

xticks( arange(5), ('Tom', 'Dick', 'Harry', 'Sally', 'Sue') )

On the page

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

If I had that problem I would try to do something like that:

xvalues = linspace(0,100,1000)

xticks(xvalues, [%.2f % val for val in xvalues])

# or, with a lambda expression, but in #python they say 
# a list comprehension is better (faster)

xticks(xvalues, map(lambda i : %.2f % i, xvalues))

The side effect is, of course, that the tick is not exactly at the position he 
indicates. Maybe you better use arange() to get the right values for your 
ticks, just make sure that they cover the interval your xvalues are in.

If you find a better solution, please let me know.

Best regards,
Philipp

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] missing module docs

2010-02-22 Thread Andrew Straw
John Hunter wrote:


 On Mon, Feb 22, 2010 at 1:44 PM, Ben Axelrod baxel...@coroware.com
 mailto:baxel...@coroware.com wrote:

 I noticed that there are many modules in the current code base
 that are not listed at:
 http://matplotlib.sourceforge.net/modindex.html.  I understand
 that a few are new files and that the documentation for these will
 be generated during the next release.  But I know that most of
 these were in the last release so should have had their
 documentation generated.  Am I missing something?  Can the
 documentation for these modules be found somewhere else?


 You're not missing anything in terms of the html/pdf docs.  When we
 converted our documentation build system to sphinx/rest, we had to
 convert our docstrings to rest as well.  We made good headway for a
 while but the progress has stalled.  To add a module to the
 documentation system, you need to

Also, it's worth nothing that the docs from svn head are automatically
compiled and uploaded from svn on each commit:

HTML: http://matplotlib.sourceforge.net/trunk-docs/index.html
PDF: http://matplotlib.sourceforge.net/trunk-docs/Matplotlib.pdf

-Andrew

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users