|
From: Chao Y. <cha...@gm...> - 2012-11-10 16:36:14
|
Thanks a lot Paul. Oh, I even didn't think about the second point raised by you. but it would be great to have. The main point is the first point raised by you, I just didn't know how to put the label (in the example figure it's value range) exactly beside the colorbar. In the attached figure you can see the labels (here the label is a number) are put at the place of connection interface of two different colors but not beside the colorbar. like for the first top blue block, I would like to have 0-10 beside it, but not to put 0 at the top and 10 at the bottom. I hope I am clear. The code that generate attached figure is here: a = np.arange(100).reshape(10,10) contourf(a,levels=np.arange(0, 101,10)) cbar = colorbar() cbar.set_ticks(np.arange(0,101,10)) cbar.set_ticklabels(np.arange(0,101,10)) could you please indicate how can I have the first and second points raised by you? thanks a lot! Chao On Sat, Nov 10, 2012 at 4:53 PM, Paul Hobson <pmh...@gm...> wrote: > On Sat, Nov 10, 2012 at 6:25 AM, Chao YUE <cha...@gm...> wrote: > > Dear all, > > > > In the colorbar label for contourf or imshow plot, I want the effect like > > that in the attached figure. Is there some way to move the position of > > colorbar label? could someone give any hints? > > > Chao, > > It's not clear what you mean. What's distinctive about the image you > attached? Is it: > - The ranges of values listed to the side? > - The discrete blocks for each value range? > - The units being listed above the colorbar? > > I think I can help you do any of those things. I just need to know > what you're specifically trying to do. > -paul > -- *********************************************************************************** Chao YUE Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL) UMR 1572 CEA-CNRS-UVSQ Batiment 712 - Pe 119 91191 GIF Sur YVETTE Cedex Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16 ************************************************************************************ |