[Matplotlib-users] Only one colorbar for a figure?

2011-01-14 Thread Thøger Emil Juul Thorsen
Hi list; 

I am trying to do an imshow() comparison of four different data sets
(astronomical photos), and since I want to show the differences in
strength, I use fixed vmin and vmax.

I would very much like one and only one colour bar for the entire
figure, but I haven't been able to figure out how to do it without
creating an entire subplot for it, and that is really kludgey and
unhandy.

I tried the Interwebz but have had no luck figuring it out.

Cheers; 

Emil


signature.asc
Description: This is a digitally signed message part
--
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Only one colorbar for a figure?

2011-01-14 Thread Benjamin Root
2011/1/14 Thøger Emil Juul Thorsen thoe...@fys.ku.dk

 Hi list;

 I am trying to do an imshow() comparison of four different data sets
 (astronomical photos), and since I want to show the differences in
 strength, I use fixed vmin and vmax.

 I would very much like one and only one colour bar for the entire
 figure, but I haven't been able to figure out how to do it without
 creating an entire subplot for it, and that is really kludgey and
 unhandy.

 I tried the Interwebz but have had no luck figuring it out.

 Cheers;

 Emil


Emil,

I had this problem once before.  You can use the axes_grid1 tool to do this:

http://matplotlib.sourceforge.net/mpl_toolkits/axes_grid/users/overview.html

Unfortunately, our documentation is a little broken on that page, but if you
take a look at this source code example, you can see how to use AxesGrid to
create a subplot grid that pre-allocates space for a single cbar
automatically!

http://matplotlib.sourceforge.net/plot_directive/mpl_toolkits/axes_grid/examples/demo_axes_grid.py

I hope this helps!

Ben Root
--
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users