[ncl-talk] Problem using 'overlay' procedure

Adam Phillips asphilli at ucar.edu
Mon Jan 14 11:54:46 MST 2019


Hi Anne,
By setting this: res2 at cnMonoFillPattern = True
you are telling NCL to use stippling for all contour ranges. That is fine,
but you'll want to alter the colors of the stippling so that all values
below 95% are set to transparent, and all values equal to or above 95 are
set to black. Looking at your resource list I don't see what you would
still be seeing lines of significance with res2 at cnLinesOn = False.

Here's a typical resource list that I use for stippling significance:
  res2 = True
  res2 at gsnDraw = False
  res2 at gsnFrame = False
  res2 at cnFillOn = True
  res2 at cnLinesOn = False
  res2 at cnLineLabelsOn = False
  res2 at cnLevelSelectionMode = "ExplicitLevels"
  res2 at cnLevels = 95.
  res2 at cnInfoLabelOn = False
  res2 at cnMonoFillPattern = False
  res2 at cnFillPatterns = (/0,17/)
  res2 at cnFillColors = (/"transparent","gray10"/)
  res2 at cnFillScaleF        = 0.4
  res2 at cnFillDrawOrder = "PreDraw"

Note as well that you should not set gsnMaximize in your res2 resource
list, as that resource should only be applied to the baseplot (plot_a) if
you are not paneling, or to the panel resource list if you are paneling.
Hope that helps!
Adam


On Mon, Jan 14, 2019 at 11:20 AM Anne <anne.seidenglanz at unive.it> wrote:

> Thanks, Rick, I will try what you suggested. To point 1, trying to get
> dots instead of lines (for significance), those are the resources I used:
>
> ; ** PLOT 2 ***
>   res2 = True                            ; res2 probability plots
>   res2 at gsnDraw             = False       ; Do not draw plot
>   res2 at gsnFrame            = False       ; Do not advance frame
>
>   res2 at cnLevelSelectionMode   =  "ManualLevels" ; set manual contour
> levels
>   res2 at cnMinLevelValF      = 90        ; set min contour level
>   res2 at cnMaxLevelValF      = 100        ; set max contour level
>   res2 at cnLevelSpacingF     = 0.1        ; set contour spacing
>
>   res2 at cnMonoFillPattern = True
>   res2 at cnFillPattern     =  17
>   res2 at cnFillDotSizeF      = 0.5
>
>   res2 at cnInfoLabelOn       = False       ; turn off info label
>   res2 at cnLinesOn           = False       ; do not draw contour lines
>   res2 at cnLineLabelsOn      = False       ; do not draw contour labels
>   res2 at gsnLeftString       =  ""
>   res2 at gsnRightString      =  ""
>
>   res2 at gsnMaximize        =    True         ; enlarge plot
>   res2 at gsnAddCyclic       =   True
>
>   plot_stat   = gsn_csm_contour(wks, aveX, res2)    ; aveX = 95% stat
> sign.
>   overlay (plot_a, plot_stat)
>
>  draw(plot_a)
>  frame(wks)
>
> *where*
> plot_a = gsn_csm_contour_map (wks, var_diff(0,:,:), res)
>
> *So I used*
>  res2 at cnMonoFillPattern = True
>   res2 at cnFillPattern     =  17
>
> to get the dots instead of lines. But this did not work and I still see
> lines instead of dots.
>
> Any hint welcome,
> thanks,
> Anne
>
>
> On Sat, Jan 12, 2019 at 9:06 PM Rick Brownrigg <brownrig at ucar.edu> wrote:
>
>> Hi,
>>
>> In answer to your second question, regarding the paneling of overlay
>> plots, it *may* be the case that you have to draw that "plot_stat" for each
>> overlay. There's wording to this effect in the docs:
>>
>> "Once you overlay *transform_id* plot, you can no longer draw it
>> separately. You can only draw the *base_id* plot, which causes the base
>> plot to be drawn along with all the plots that have been overlaid on it."
>>
>> which suggests to me that you can't reuse plot_stat for the second
>> overlay.  I don't know this for certain -- it is speculation and perhaps
>> something to try out.
>>
>> Its hard to say about your first question -- in what sense does it not
>> work?  We don't see all the resources you used -- is it the case you have:
>>
>>   res at gsnDraw             = False       ; Do not draw plot
>>   res at gsnFrame            = False       ; Do not advance frame
>>
>> for the first plot (plot_a)?
>>
>> Rick
>>
>> On Sat, Jan 12, 2019 at 12:27 PM Anne <anne.seidenglanz at unive.it> wrote:
>>
>>> Hi everyone,
>>>
>>> basically, I am coming with 2 issues here:
>>>
>>> 1) I am trying to stipple the 95% statistical significance, for this
>>> purpose I have set 2 resource lists: one for the base contours, and one for
>>> the stat. significance contours on top. For the resource list on top, I
>>> have set
>>>
>>>   res2 at cnMonoFillPattern = True
>>>   res2 at cnFillPattern     =  17
>>>
>>> to get the dots instead of lines. Somehow that change didn't work. Did I
>>> miss something?
>>>
>>> 2) How do I panel plots that are produced using the 'overlay' procedure?
>>> I have tried using
>>>
>>> plot(0) = overlay(plot1, plot_stat)
>>> plot(1) = oberlay(plot2, plot_stat)
>>>
>>> etc. but that gave me an error message.
>>>
>>> Thanks for any help and sorry if I had missed these issues in earlier
>>> conversations.
>>> Anne
>>>
>>> - - - - - - - - - - - - - - - - - - - - - - - - - -
>>> For point 1), here are my resources:
>>>
>>> ; ** PLOT1 **
>>> ... res1 resources, filled contours, all good....
>>>
>>>      plot_a = gsn_csm_contour_map (wks, var_diff(0,:,:), res)
>>>
>>>  ; ** PLOT 2 ***
>>>   res2 = True                            ; res2 probability plots
>>>   res2 at gsnDraw             = False       ; Do not draw plot
>>>   res2 at gsnFrame            = False       ; Do not advance frame
>>>
>>>   res2 at cnLevelSelectionMode = "ManualLevels" ; set manual contour levels
>>>   res2 at cnMinLevelValF      = 90        ; set min contour level
>>>   res2 at cnMaxLevelValF      = 100        ; set max contour level
>>>   res2 at cnLevelSpacingF     = 0.1        ; set contour spacing
>>>
>>>   res2 at cnMonoFillPattern = True
>>>   res2 at cnFillPattern     =  17
>>>   res2 at cnFillDotSizeF      = 0.5
>>>
>>>   res2 at cnInfoLabelOn       = False       ; turn off info label
>>>   res2 at cnLinesOn           = False       ; do not draw contour lines
>>>   res2 at cnLineLabelsOn      = False       ; do not draw contour labels
>>>   res2 at gsnLeftString       =  ""
>>>   res2 at gsnRightString      =  ""
>>>
>>>   res2 at gsnMaximize        =    True         ; enlarge plot
>>>   res2 at gsnAddCyclic       =   True
>>>
>>>   plot_stat   = gsn_csm_contour(wks, aveX, res2)    ; aveX = 95% stat
>>> sign.
>>>   overlay (plot_a, plot_stat)
>>>
>>>  draw(plot_a)
>>>  frame(wks)
>>>
>>>
>>> Nota automatica aggiunta dal sistema di posta.
>>> _______________________________________________
>>> ncl-talk mailing list
>>> ncl-talk at ucar.edu
>>> List instructions, subscriber options, unsubscribe:
>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>
>>
> Nota automatica aggiunta dal sistema di posta.
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>


-- 
Adam Phillips
Associate Scientist,  Climate and Global Dynamics Laboratory, NCAR
www.cgd.ucar.edu/staff/asphilli/   303-497-1726

<http://www.cgd.ucar.edu/staff/asphilli>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190114/c95159d1/attachment.html>


More information about the ncl-talk mailing list