Re: shaded colors over a gray filled continent

From: Adam Phillips <asphilli_at_nyahnyahspammersnyahnyah>
Date: Fri May 17 2013 - 10:51:24 MDT

Hi Andries,
I think what you want it possible, but it is a bit complex.

First, with regards to adding gray to your colormap, add this:
nr = NhlNewColor(wks,0.82,0.82,0.82) ; add gray82, a lighter gray
see: http://www.ncl.ucar.edu/Document/Functions/Built-in/NhlNewColor.shtml

then to fill the oceans:
res@mpFillOn = True
res@mpFillColors = (/-1,14,-1,-1/) ; 14 = gray82, as gray 82 is added
to the end of precip_11lev
res@mpFillDrawOrder = "PreDraw" ; tell NCL to map fill first
http://www.ncl.ucar.edu/Document/Graphics/Resources/mp.shtml#mpFillColors

Next, I would not color the missing values gray/black in the Aphrodite
plots nor set gsnSpreadColors. I would set all areas that are missing to
0 value, and then set all values less than 1 (or whatever you want) to
transparent. To do this, you will have to specify cnFillColors:
;res@cnMissingValFillColor = "black" ; comment this line out
res@gsnSpreadColors = False
res@cnLevels = fspan(1,11,11)
res@cnFillColors = (/-1,3,4,5,6,7,8,9,10,11,12,13/) ; note: values
less that 1 are set to transparent

and just to be sure that your contour fill happens last, set
cnFillDrawOrder to PostDraw
res@cnFillDrawOrder = "PostDraw"
http://www.ncl.ucar.edu/Applications/draworder.shtml

Hopefully that works. If not, please respond to ncl-talk.
Adam

On 05/17/2013 02:45 AM, Andries De Vries wrote:
> Dear All,
>
> In addition to the previous email, I send attached the NCL script that
> was used. Note that I did not send the script as for the plots sent
> previously (the corresponding data files are way too big and too many
> to upload them properly), but for a similar plot, see the attachment.
> The idea is the same. The plot shows precipitation from era-interim
> (left side) and aphrodite (right side). Now I want for the Era-interim
> data (left hand side) fo fill in the continent or sea surface with a
> light gray color to show a contrast between the continents and sea for
> better visibility of the topography, without disturbing the
> precipitation colors.
>
> The Aphrodite plot (right hand side) shows missing values in black; I
> did not need to add this color to the color table, since it is already
> included. However, when I would like to change the black color of
> missing values into light gray, I have to add this color to the color
> table (I use NCL version 6.0.0). I could do the same for the
> Era-Interim plot, via adding a gray color to the color table for
> values of e.g. -2 to -1, and then to change the precipitation values
> over continents or sea surface with "0" precipitation values to -1, so
> the continent or sea will be filled gray where there is no precipitation.
>
> My question is if there is a more easy way to fill in continent or sea
> surface with gray, while the precipitation colors appear always on top
> (as dominant color). And if the above described solution is the only
> one, how should I remove again the added gray color from the color
> table in the final plot (I dont want to show the gray color in the
> color table for negative precipitation values).
>
> The names of the script, the plot, and the data in the map "incoming"
> are as follows:
> - precipitation_ERA-Int_APHRO_daily_PANEL_ncl-talk.ncl (also attached)
> - PRECIP_ERA-Int_Aphro_daily_CT2_ncl-talk_1987-10-15_to_18.pdf (also
> attached)
> - ei_fc_totprec_gg128_step12_198710.grib
> - APHRO_ME_025deg_V1101.1987.nc
>
> Thanks a lot in advance!
> Cheers,
> Andries
>
>
> ------------------------------------------------------------------------
> *From:* Andries De Vries [mailto:a.devries@cyi.ac.cy]
> *To:* ncl-talk@ucar.edu
> *Sent:* Thu, 16 May 2013 19:33:22 +0200
> *Subject:* [ncl-talk] shaded colors over a gray filled continent
>
> Dear NCL users,
>
> I use NCL (version 6.0.0) to make a panel plot that shows
> precipitation (colors) and geopotential height contours at 1000
> (solid lines) and 500 hPa (dashed lines). See attached plot1. This
> figure is very busy and it may be difficult for the reader to
> recognize the region with respect to the topography. One way to
> make this plot more clear might be to fill the continent or sea
> surface with a light gray color, but without dominating the
> precipitation. So far I have not seen an example on the NCL UCAR
> website that shows both shaded colors over a gray filled
> continent/sea. What would be the most easy solution for this?
>
> I have one potential idea. Previously I made a similar plot (see
> attached plot 2) with missing values in gray shaded colors. For
> this I had to add in a complicated way a gray color to the color
> table. In a similar way I could add a gray color to the color
> table in plot1 for values from e.g. -2 to 0; and to change
> precipitation values of "0" over land or sea to e.g. -1. As such
> the land or sea surface without precipitation will be filled gray.
> However, I do not want the gray color to be included in the color
> table. How should I remove one color from the final color table
> without losing the color in the plot?
>
> Thank you very much for any helpful suggestion!
>
> Cheers
> Andries
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-- 
______________________________________________________________
Adam Phillips                                asphilli@ucar.edu
NCAR/Climate and Global Dynamics Division       (303) 497-1726
P.O. Box 3000				
Boulder, CO 80307-3000    http://www.cgd.ucar.edu/cas/asphilli

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri May 17 10:51:32 2013

This archive was generated by hypermail 2.1.8 : Thu May 30 2013 - 11:38:10 MDT