________________________________
 From: Benjamin Root <ben.r...@ou.edu>
To: Michael Rawlins <rawlin...@yahoo.com> 
Cc: "matplotlib-users@lists.sourceforge.net" 
<matplotlib-users@lists.sourceforge.net> 
Sent: Tuesday, January 17, 2012 2:02 PM
Subject: Re: [Matplotlib-users] placing colorbar when using subplot command
 



On Tue, Jan 17, 2012 at 12:37 PM, Michael Rawlins <rawlin...@yahoo.com> wrote:


>
>
>
>
>________________________________
> From: Benjamin Root <ben.r...@ou.edu>
>To: Michael Rawlins <rawlin...@yahoo.com> 
>Cc: "matplotlib-users@lists.sourceforge.net" 
><matplotlib-users@lists.sourceforge.net> 
>Sent: Tuesday, January 17, 2012 10:36 AM
>Subject: Re: [Matplotlib-users] placing colorbar when using subplot command
> 
>
>
>
>On Tue, Jan 17, 2012 at 9:30 AM, Michael Rawlins <rawlin...@yahoo.com> wrote:
>
>
>>
>>I'm relatively new to matplotlib. Trying to place a colorbar in a figure. The 
>>code below, placed in a file and executed with python, draws 4 maps using 
>>basemap. I've been unable to get a colorbar to show up anywhere on the 
>>figure. Ideally I would like the option of placing a colorbar across the 
>>bottom, spanning across both bottom map panels.  Also would need the option 
>>of placing a colorbar either to the right of or below each map. Uncommenting 
>>the two lines under "Here make a colorbar" cause an error. I've used those 
>>commands when creating just one map using the figure command.
>>
>>
>>TIA,
>>Mike
>>
>>
>>
>>
>
>Mike,
>
>Try using the axes_grid1 toolkit to produce your axes objects and to allocate 
>enough room for colorbars.
>
>http://matplotlib.sourceforge.net/mpl_toolkits/axes_grid/index.html
>
>Cheers!
>Ben Root
>
>P.S. - a little history, there used to be an axes_grid toolkit, but has since 
>been superseded by axes_grid1.
>
>
>Clicking on source code on that page produces an error. For several of the 
>graphic on that page, dropping the code into a file and running also produces 
>various errors. Being new to this software, having a specific example that I 
>can run and then incorporate into my code would be a big help. 
>
>Mike
>
>
>

Mike,

I do apologize for that.  We will have to get that fixed on the website (not 
sure why it is happening).  I have attached an example file for you to try.  
Also, which version of matplotlib are you running?  Without the error message 
you are getting, it would be hard to tell you what is wrong (most likely it is 
a version issue).

Ben Root


Ben et al.

This line causes the error:

from mpl_toolkits.axes_grid1 import AxesGrid

Traceback (most recent call last):
  File "demo_axes_grid.py", line 2, in <module>
    from mpl_toolkits.axes_grid1 import AxesGrid
  File 
"/usr/local/lib/python2.6/dist-packages/mpl_toolkits/axes_grid1/__init__.py", 
line 4, in <module>
    from axes_grid import Grid, ImageGrid, AxesGrid
  File 
"/usr/local/lib/python2.6/dist-packages/mpl_toolkits/axes_grid1/axes_grid.py", 
line 6, in <module>
    import colorbar as mcolorbar
  File 
"/usr/local/lib/python2.6/dist-packages/mpl_toolkits/axes_grid1/colorbar.py", 
line 26, in <module>
    from matplotlib import docstring
ImportError: cannot import name docstring


I see no axes_grid1.py where I guess it belongs. Here's what's in 
/usr/share/pyshared/mpl_toolkits/axes_grid


parasite_axes.py            axislines.py  anchored_artists.py  inset_locator.py
grid_helper_curvelinear.py  axes_size.py  __init__.py
grid_finder.py              axes_rgb.py   axes_divider.py
clip_path.py                axes_grid.py  angle_helper.py


Do I need to upgrade python?  Matplotlib?  Add just a file or two?

Mike
------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to