[ncl-talk] Hatch over contour plot
Marston Ward
marston.johnston at gu.se
Thu Mar 8 13:37:27 MST 2018
Hi Jared & Mary,
Thanks for the responses. These are all good and show, for me, new ways to use NCL.
Unfortunately, as Jared pointed out, I’m not trying to hatch my figure based on the contours values.
I’m working on a publication so forgive me if I hesitate to send to all of ncl-talk. Let me explain a bit more.
I have to two panel containing 2 plots, but these plots have x-axis of different lengths (just by 1 value) e.g., plot 1 has a x-value from 0:10 and plot 2: 1:10.
Since I’m comparing model results with observations I would like to put a hatch box over the plot 1 between x= 0 and x= 1 so that the reader can still see the contours beneath but note the different ranges of the plots.
The examples Mary suggested didn’t really cover this example. apologies for not being more clear first time around.
I tried the following with the thought of adding a box with hatch fill between x= 0 and x=1 but zero effect later when I plot the panel.
ypt =(/-50.0,-27.5/)
xpt =(/0.0,19.0/)
polyres = True
polyres at gsFillColor = "black"
polyres at gsFillIndex = 3
polyres at gsFillOpacityF = 0.2
dum2 = gsn_add_polygon(wks,plot(0),xpt,ypt,polyres) ; add polygon
Am I barking up the wrong tree here or am I making an error somewhere?
Appreciate the help guys,
/M
On 8 Mar 2018, at 18:30, Mary Haley <haley at ucar.edu<mailto:haley at ucar.edu>> wrote:
Hi Marston,
If you simply want to draw hatching on top of an existing contour plot, then you can use gsn_contour_shade.
http://www.ncl.ucar.edu/Document/Graphics/Interfaces/gsn_contour_shade.shtml
This function is for the sole purpose of taking an existing contour plot, and adding some hatching or stippling to highlight an area of interest.
Here are some examples:
http://www.ncl.ucar.edu/Applications/conOncon.shtml#ex4
http://www.ncl.ucar.edu/Applications/coneff.shtml#ex11
http://www.ncl.ucar.edu/Applications/overlay.shtml#ex5
http://www.ncl.ucar.edu/Applications/wavelet.shtml#ex3
Some of these may not use gsn_contour_shade.
Let ncl-talk know if this is not what you're after.
--Mary
On Thu, Mar 8, 2018 at 3:47 AM, Marston Ward <marston.johnston at gu.se<mailto:marston.johnston at gu.se>> wrote:
Hi,
I’m trying to mask a part of a gsn_csm_contour plot using a “hatch”. I don’t want to simply mask out the area because I want to the data to still be visible under the hatch.
Is it possible to do this in NCL? A simple search returned nothing in NCL. Just wondering if this is possible and it so, are there examples.
Best,
/M
Marston S. Ward
_______________________________________________
ncl-talk mailing list
ncl-talk at ucar.edu<mailto:ncl-talk at ucar.edu>
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
_______________________________________________
ncl-talk mailing list
ncl-talk at ucar.edu<mailto:ncl-talk at ucar.edu>
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180308/4bad5d78/attachment.html>
More information about the ncl-talk
mailing list