Re: questions regarding Taylor diagram scripts

From: Adam Phillips <asphilli_at_nyahnyahspammersnyahnyah>
Date: Wed Jun 06 2012 - 14:42:01 MDT

Hi Erik,
For all of those things you will need to alter taylor_diagram.ncl.
However, I don't think any of them would be terribly difficult to do.

For instance, to remove the labeling above the markers you could simply
comment out these 3 lines (lines 380, 389 and 475):

dum11 = dum10
dum11(n*nVar+i) = gsn_add_text(wks,taylor,(i+1),X(n,i),Y(n,i)+markerTxYOffset,ptRes)
taylor@$unique_string("dum")$ = dum11 ; text

That of course would remove all the text. If you want some labeling to
appear (as text) and other markers to not be labeled, you could pass in
an array of labels to taylor_diagram.ncl attached as a resource:

; in your script
labels = new(70,string)
labels = ""
labels(64:66) = (/"PrecipObs1","PrecipObs2","PrecipObs3"/)
labels(67:68) = (/"Rean1","Rean2"/)
labels(69) = (/"Benchmark1"/)
res@markerLabels = labels

; in taylor_diagram.ncl
; replace line 389 (note that "(i+1)" represents the label):

dum11(n*nVar+i) = gsn_add_text(wks,taylor,(i+1),X(n,i),Y(n,i)+markerTxYOffset,ptRes)

with this:

if (rOpts .and. isatt(rOpts,"markerLabels")) then
    dum11(n*nVar+i) = gsn_add_text(wks,taylor,rOpts@markerLabels(i),X(n,i),Y(n,i)+markerTxYOffset,ptRes)
else
    dum11(n*nVar+i) = gsn_add_text(wks,taylor,(i+1),X(n,i),Y(n,i)+markerTxYOffset,ptRes)
end if

With regards to labeling the RMS circles, see lines 292-330. Adding
labels to the circles is a matter of using the resource
gsLineLabelString. I would add this at say line 301: rms_labels =
(/0.75,0.5,0.25,0.0/), then add a line right after the do loop starts at
line 309: respl@gsLineLabelString = rms_labels(n-1)

Other options (change the color of the labels, font size, etc.) can be
added as desired...

Hope that helps.. Adam

On 06/06/2012 01:00 PM, Erik N wrote:
> Hi.
>
> How can I have RMS values appear on the RMS cycles?
>
> How can I turn on/off the numbers that appear with each point
> plotted on the diagram?
>
> Lastly, how can I make some of the point labels into strings (
> e.g...one point says NNRP2 whereas another point nearby says MERRA?)
>
> Can all of this be solved with makeing changes in the required
> taylor_diagram.ncl script or can thye be solved using the interface
> script (below)?
>
> Below is the script I used to make the following picture.
> Basically, I want to keep the red numbers as they are (or make them
> disappear), but put labels on the blue green and orange points instead
> of numbers.
>
> Any tips? Thank you ahead of time.
> Sincerely,
> Erik
>
> Erik Noble | Research Assistant | NASA Goddard Institute for Space Studies
> Direct: 1 (212) 678-5512 | www.giss.nasa.gov
> <http://www.giss.nasa.gov> | 2880 Broadway, New York, NY-10025
>
>
> ;**********************************
> ; taylor_1_Erik.ncl
> ;**********************************
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
> load "./taylor_diagram.ncl"
> ;**********************************
> begin
> ;**********************************
> data =
> readAsciiTable("../results_all_vs_trmm_7-18_ratio.text",5,"float",0)
> ; Only dataset. One text file. Split the data up into
> model=data(:,0)
> ; Model points
> cc_1=data(0:63,1)
> ratio_1=data(0:63,3)
> ; Precipitation Observations
> cc_2=data(64:66,1)
> ratio_2=data(64:66,3)
> ; Reanalysis Data
> cc_3=data(67:68,1)
> ratio_3=data(67:68,3)
> ; Benchmark Model
> cc_4=data(69,1)
> ratio_4=data(69,3)
>
> ;**********************************
> ; Put the ratios and pattern correlations into
> ; arrays for plotting
> ;**********************************
> nDataSets = 4 ; number of datasets
> npts = dimsizes(data(:,0))
> ratio = new ((/nDataSets, npts/),typeof(ratio_1) )
> cc = new ((/nDataSets, npts/),typeof(cc_1) )
>
> ratio(0,0:63) = ratio_1
> cc(0,0:63) = cc_1
>
> ratio(1,64:66) = ratio_2
> cc(1,64:66) = cc_2
>
> ratio(2,67:68) = ratio_3
> cc(2,67:68) = cc_3
>
> ratio(3,69) = ratio_4
> cc(3,69) = cc_4
> ;**********************************
> ; create plot
> ;**********************************
> wks = gsn_open_wks("pdf","taylor_test")
>
> res = True ; diagram mods desired
> res@tiMainString = "Example" ; title
> res@Colors = (/"red","blue","green","orange"/) ;
> marker colors
> res@Markers = (/2,7,6,15/) ; marker styles
> res@markerTxYOffset = 0.04 ; offset btwn
> marker & label
> ;res@gsMarkerSizeF = 0.008 ; marker size
> ;res@txFontHeightF = 0.039 ; text size
>
> res@stnRad = (/ 0.5, 1.5 /) ; additional standard radii
> res@ccRays = (/ 0.6, 0.9 /) ; correllation rays
> res@ccRays_color = "LightGray" ; default is "black"
>
> res@centerDiffRMS = True ; RMS 'circles'
> res@centerDiffRMS_color = "LightGray" ; default is "black"/)
>
> plot = taylor_diagram(wks, ratio, cc, res)
> end
>
>
>
>
>
> _______________________________________________
> 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 Wed Jun 6 14:42:11 2012

This archive was generated by hypermail 2.1.8 : Wed Jun 06 2012 - 15:17:44 MDT