[ncl-talk] taylor plot question

Adam Phillips asphilli at ucar.edu
Fri Dec 7 15:11:27 MST 2018


Hi Jonathan,
Unfortunately it seems like the numbering of the markers is hardwired into
the taylor_diagram.ncl script. You can get around this though, by adding
your own special resource and hacking the function code a bit. I would
recommend copying taylor_diagram.ncl to taylor_diagram_mod.ncl, load the
latter file at the top or your script, and do the following:
1 - Create a new resource to pass into taylor_diagram_mod.ncl with the size
of the logical variable being equal to the number of cases. If you have 4
cases and only want labels to be drawn for the first two cases it would be
set like this:
res at CaseMarkerLabelDraw = (/True,True,False,False/)

2 - Modify taylor_diagram_mod.ncl to recognize this new resource. The part
of the code where the polymarkers and drawn and labeled is lines 379-387.
Change this:
do n=0,nCase-1
     gsRes at gsMarkerIndex   = Markers(n)             ; marker style (+)
     gsRes at gsMarkerColor   = Colors(n)              ; marker color
     ptRes at txFontColor     = gsRes at gsMarkerColor
    do i=0,nVar-1
       dum10(n*nVar+i) = gsn_add_polymarker(wks,taylor,X(n,i),Y(n,i),gsRes)
       dum11(n*nVar+i) =
gsn_add_text(wks,taylor,(i+1),X(n,i),Y(n,i)+markerTxYOffset,ptRes)
    end do
  end do

do this:

do n=0,nCase-1
     gsRes at gsMarkerIndex   = Markers(n)             ; marker style (+)
     gsRes at gsMarkerColor   = Colors(n)              ; marker color
     ptRes at txFontColor     = gsRes at gsMarkerColor
    do i=0,nVar-1
       dum10(n*nVar+i) = gsn_add_polymarker(wks,taylor,X(n,i),Y(n,i),gsRes)
       if (gsRes at CaseMarkerLabelDraw(n)) then
          dum11(n*nVar+i) =
gsn_add_text(wks,taylor,(i+1),X(n,i),Y(n,i)+markerTxYOffset,ptRes)
       end if
    end do
  end do

I believe that should do it. Hope that makes sense. If you have any further
questions let ncl-talk know.
Adam




On Fri, Dec 7, 2018 at 10:19 AM Buzan, Jonathan <jbuzan at purdue.edu> wrote:

> Hi NCL,
>
> I am attempting to make a taylor plot.  My multi-model mean ESI and sWBGT
> have labels of “1” next to them.  I would like to remove that label.  The
> numbers correspond to other models, and not the multi-model mean.
>
> How I call in the data: (/4, 18/).  ({0,2},:) = CMIP5 sWBGT and ESI data.
> ({2,3},0) = single slot multi-model mean sWBGT and ESI, the rest is fill
> value.
>
> Goals of the plot:
> 1) 2 variables on the plot.
> 2) 18 CMIP5 models
> 3) two multi-model means.
> 4) clear color difference between CMIP5 models and CMIP5 average.
>
> Thanks for the help!
>
> -Jonathan
>
>
> _______________________________________________
> 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/20181207/1fcc3c13/attachment.html>


More information about the ncl-talk mailing list