Re: reverse a colorbar but keep the label bar

From: <mamadoulamine.mbaye_at_nyahnyahspammersnyahnyah>
Date: Fri Mar 21 2014 - 09:22:36 MDT

Hi Mary,
You're welcome
Thank you also for giving another way to do it.
Best Regards
Mamadou
________________________________________
De : Mary Haley <haley@ucar.edu>
Envoyé : vendredi 21 mars 2014 07:29
À : juki juki
Cc : ncl-talk@ucar.edu USERS; mamadoulamine.mbaye@ucad.edu.sn
Objet : Re: [ncl-talk] reverse a colorbar but keep the label bar

Thanks Mamadou, you answered the question much more elegantly than I was about to!

The cnFillPalette resource is an excellent one to use if you need to change colormaps for
multiple plots that you are drawing on one page.

In fact, it's probably best to stay away from gsn_reverse_colormap, and instead use
read_colormap_file, reverse the indices, and use that for the other colormaps.

For example, if you want to use the "rainbow" colormap:

cmap = read_colormap_file("rainbow")
cmap_r = cmap(::-1,:)

Now, you can set cnFillPalette to either one of these as desired:

res@cnFillPalette = cmap_r ; for the reverse color map

--Mary

On Mar 21, 2014, at 2:11 AM, mamadoulamine.mbaye@ucad.edu.sn wrote:

> Hi Juki,
> I think you can first plot the 5 plots by using the gsn_reverse_colormap(wks),
> and after put res@cnFillPalette = " the name of your color map " before plotting
> the last plot.
> Hope this helps!
> Mamadou,
> Regards
>
> De : ncl-talk-bounces@ucar.edu <ncl-talk-bounces@ucar.edu> de la part de juki juki <juky_emc2@yahoo.com>
> Envoyé : jeudi 20 mars 2014 15:14
> À : juki juki; ncl-talk@ucar.edu
> Objet : Re: [ncl-talk] reverse a colorbar but keep the label bar
>
> Dear All NCL users..
>
> I have a multiplot with wks using reverse colorbar:
>
> gsn_reverse_colormap(wks)
>
> However, I have 6 plots and one of the plot needs the non-reverse colorbar. I try the command reverse_labelbar(plt), but the colorbar and the label bar were reversed. I want to reverse the colorbar and keep the label bar or vice versa.
>
> Thanks for sharing..
>
> -joeky
>
>
>
> On Thursday, March 20, 2014 10:45 PM, juki juki <juky_emc2@yahoo.com> wrote:
> Dear All NCL users..
>
> I have a multiplot with wks using reverse colorbar:
>
> gsn_reverse_colormap(wks)
>
> However, I have 6 plots and one of the plot needs the non-reverse colorbar. I try the command reverse_labelbar(plt), but the colorbar and the label bar were reversed. I want to reverse the colorbar and keep the label bar or vice versa.
>
> Thanks for sharing..
>
> Regards;
> joeky
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Mar 21 09:23:04 2014

This archive was generated by hypermail 2.1.8 : Fri Mar 21 2014 - 15:49:21 MDT