<div dir="ltr"><div>replace:</div><div>from res2 = "True" <br></div><div> to    res2 = True</div><div><br></div><div>By placing True in double quotes makes res2 a string rather than a logical expression. <br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, May 31, 2018 at 11:13 AM, Tyler Herrington <span dir="ltr"><<a href="mailto:therring@uwaterloo.ca" target="_blank">therring@uwaterloo.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>

<div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">Good afternoon,</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">I am attempting to create a scatterplot in which each data point has a specified color and marker style:</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><br></div><blockquote style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;margin:0px 0px 0px 40px;border:none;padding:0px"><div><div>; These files are loaded by default in NCL V6.2.0 and newer</div></div><div><div>load "$NCARG_ROOT/lib/ncarg/nclscri<wbr>pts/csm/gsn_code.ncl"</div></div><div><div>load "$NCARG_ROOT/lib/ncarg/nclscri<wbr>pts/csm/gsn_csm.ncl"</div></div><div><div>load "$NCARG_ROOT/lib/ncarg/nclscri<wbr>pts/csm/contributed.ncl"</div></div><div><div>load "$NCARG_ROOT/lib/ncarg/nclscri<wbr>pts/csm/shea_util.ncl"</div></div><div><div><br></div></div><div><div><br></div></div><div><div>begin</div></div><div><div><br></div></div><div><div>;*********************</div></div><div><div>; Create model array</div></div><div><div>;*********************</div></div><div><div><br></div></div><div><div>mdl = new((/28,1/),"string")</div></div><div><div>mdl(0,0) = "ACCESS1-0"</div></div><div><div>mdl(1,0) = "ACCESS1-3"</div></div><div><div>mdl(2,0) = "bcc-csm1-1"</div></div><div><div>mdl(3,0) = "bcc-csm1-1-m"</div></div><div><div>mdl(4,0) = "BNU-ESM"</div></div><div><div>mdl(5,0) = "CanESM2"</div></div><div><div>mdl(6,0) = "CCSM4"</div></div><div><div>mdl(7,0) = "CNRM-CM5"</div></div><div><div>mdl(8,0) = "CSIRO-Mk3-6-0"</div></div><div><div>mdl(9,0) = "FGOALS-g2"</div></div><div><div>mdl(10,0) = "FGOALS-s2"</div></div><div><div>mdl(11,0) = "GFDL-CM3"</div></div><div><div>mdl(12,0) = "GFDL-ESM2G"</div></div><div><div>mdl(13,0) = "GFDL-ESM2M"</div></div><div><div>mdl(14,0) = "GISS-E2-H"</div></div><div><div>mdl(15,0) = "GISS-E2-R"</div></div><div><div>mdl(16,0) = "HadGEM2-ES"</div></div><div><div>mdl(17,0) = "inmcm4"</div></div><div><div>mdl(18,0) = "IPSL-CM5A-LR"</div></div><div><div>mdl(19,0) = "IPSL-CM5A-MR"</div></div><div><div>mdl(20,0) = "IPSL-CM5B-LR"</div></div><div><div>mdl(21,0) = "MIROC5"</div></div><div><div>mdl(22,0) = "MIROC-ESM"</div></div><div><div>mdl(23,0) = "MPI-ESM-LR"</div></div><div><div>mdl(24,0) = "MPI-ESM-MR"</div></div><div><div>mdl(25,0) = "MPI-ESM-P"</div></div><div><div>mdl(26,0) = "MRI-CGM3"</div></div><div><div>mdl(27,0) = "NorESM1-M"</div></div><div><div><br></div></div><div><div><br></div></div><div><div>;*****************************<wbr>***************</div></div><div><div>; Read in Tundra and Boreal Albedo Feedbacks</div></div><div><div>;*****************************<wbr>***************</div></div><div><div><br></div></div><div><div>TundirMAM = "/praid/users/herringtont/Cald<wbr>well_2016/monthly_data/CLM/by_<wbr>model/alb_fbk_maps/All.Tundra/<wbr>fldmean/seasmean/MAM/"</div></div><div><div><br></div></div><div><div>BordirMAM = "/praid/users/herringtont/Cald<wbr>well_2016/monthly_data/CLM/by_<wbr>model/alb_fbk_maps/NET.Boreal/<wbr>fldmean/seasmean/MAM/"</div></div><div><div><br></div></div><div><div>TunfilMAM = TundirMAM+"<a href="http://cmip5_fbks_monres_mam_allmodels_alb_fbk_maps_all.tundra_seasmean.nc/" style="color:rgb(17,85,204)" target="_blank">CMIP5_fbks_monres_M<wbr>AM_AllModels_alb_fbk_maps_All.<wbr>Tundra_seasmean.nc</a>"</div></div><div><div><br></div></div><div><div>BorfilMAM = BordirMAM+"<a href="http://cmip5_fbks_monres_mam_allmodels_alb_fbk_maps_net.boreal_seasmean.nc/" style="color:rgb(17,85,204)" target="_blank">CMIP5_fbks_monres_M<wbr>AM_AllModels_alb_fbk_maps_NET.<wbr>Boreal_seasmean.nc</a>"</div></div><div><div><br></div></div><div><div>TunMAM = addfile(TunfilMAM,"r")</div></div><div><div>BorMAM = addfile(BorfilMAM,"r")</div></div><div><div><br></div></div><div><div>TunMAM2 = TunMAM->alb_fbk_maps(:,0,0)</div></div><div><div>BorMAM2 = BorMAM->alb_fbk_maps(:,0,0)</div></div><div><div><br></div></div><div><div>ccr = escorc(BorMAM2,TunMAM2) ; calculate correlation coefficient</div></div><div><div>ccr2 = decimalPlaces(ccr,3,True)</div></div><div><div><br></div></div><div><div>;*****************************<wbr>*************************</div></div><div><div>; Create MAM Seasonal Mean Albedo Feedback Scatterplot</div></div><div><div>;*****************************<wbr>*************************</div></div><div><div><br></div></div><div><div>wks  = gsn_open_wks("png","MAM_Albedo<wbr>_Feedback_ScatterPlot_corr_<wbr>labels")             ; send graphics to PNG file</div></div><div><div><br></div></div><div><div>res2                     = "True"                   ; plot mods desired</div></div><div><div><br></div></div><div><div>res2@tmLabelAutoStride = True                     ; nice tick mark labels</div></div><div><div>res2@xyMarkLineMode         = "Markers"</div></div><div><div><br></div></div><div><div>res2@xyMarkers              = (/0,0,1,1,2,3,4,5,6,7,7,8,8,8,<wbr>9,9,10,11,12,12,12,13,13,14,14<wbr>,14,15,16/)  </div></div><div><div><br></div></div><div><div>res2@xyMonoMarkerColor      = "False"         ; Allow different colors for markers</div></div><div><div><br></div></div><div><div>res2@xyMarkerColors         = (/"dodgerblue2","dodgerblue4",<wbr>"firebrick4","tomato3","darksl<wbr>ategrey","forestgreen","chocol<wbr>ate4","plum3","seagreen","<wbr>cyan2","cyan4","mediumorchid2"<wbr>,"mediumorchid4","<wbr>mediumpurple3","orange2","oran<wbr>ge4","antiquewhite4","violetre<wbr>d","salmon","salmon2","<wbr>salmon4","blue","blue4","gold4<wbr>","goldenrod2","yellow4","<wbr>magenta4","darkolivegreen4"/)</div></div><div><div><br></div></div><div><div>res2@xyExplicitLabels       = (/mdl(0,0),mdl(1,0),mdl(2,0),m<wbr>dl(3,0),mdl(4,0),mdl(5,0),mdl(<wbr>6,0),mdl(7,0),mdl(8,0),mdl(9,<wbr>0),mdl(10,0),mdl(11,0),mdl(12,<wbr>0),mdl(13,0),mdl(14,0),mdl(15,<wbr>0),mdl(16,0),mdl(17,0),mdl(18,<wbr>0),mdl(19,0),mdl(20,0),mdl(21,<wbr>0),mdl(22,0),mdl(23,0),mdl(24,<wbr>0),mdl(25,0),mdl(26,0),mdl(27,<wbr>0)/) </div></div><div><div><br></div></div><div><div>res2@xyMarkerSizeF       = 0.005                  ; Marker size (default 0.01)</div></div><div><div>res2@tiYAxisString = "Tundra Albedo Feedback (Wm~S~-2~N~K~S~-1~N~)"</div></div><div><div>res2@tiXAxisString = "Boreal Albedo Feedback (Wm~S~-2~N~K~S~-1~N~)"</div></div><div><div>res2@tiMainString = "MAM Mean Albedo Feedbacks"</div></div><div><div>res2@trYMinF             = 0.0</div></div><div><div>res2@trYMaxF             = 4.0</div></div><div><div>res2@trXMinF             = -0.75</div></div><div><div>res2@trXMaxF             = 1.5</div></div><div><div><br></div></div><div><div>res2@gsnDraw       = False          ; do not draw </div></div><div><div>res2@gsnFrame      = False          ; do not advance</div></div><div><div><br></div></div><div><div>txres                    = True</div></div><div><div>txres@txFontHeightF = 0.015                   ; change font height</div></div><div><div><br></div></div><div><div>;---Set some legend resurces</div></div><div><div>res2@pmLegendDisplayMode    = "Always"         ; Turn on the legend</div></div><div><div>res2@lgOrientation          = "horizontal"     ; Default is vertical</div></div><div><div>res2@pmLegendWidthF         = 0.5             ; Make it wider</div></div><div><div>res2@pmLegendOrthogonalPosF = -0.2             ; Move it up slightly</div></div><div><div>res2@lgPerimOn              = False            ; Turn off the perimeter box</div></div><div><div><br></div></div><div><div><br></div></div><div><div>plot = gsn_csm_xy(wks,BorMAM2,TunMAM2<wbr>,res2)                  ; create plot</div></div><div><div>draw(plot)</div></div><div><div>dum = gsn_add_text(wks,plot,"Pearson Correlation: "+ccr2,-0.2,3.8,txres)</div></div><div><div>frame(wks)</div></div><div><div><br></div></div><div><div>system("mv *.png /home/herringtont/Caldwell_201<wbr>6/figures/scatterplot")</div></div><div><div><br></div></div><div><div>end</div></div></blockquote><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">Upon running the script, however, I get the following error:</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><div><br></div><div>fatal:Argument type mismatch on argument (3) of (gsn_csm_xy) can not coerce</div><div>fatal:["Execute.c":8640]:Execu<wbr>te: Error occurred at or near line 107 in file Boreal_Tundra_Scatterplot.ncl</div></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">Which leads me to suspect that something is wrong with the way that I am specifying resources for the plot. Any suggestions on what could be causing this?</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">Thank You,</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><br></div>

Sincerely,</div><br clear="all"><div><div class="m_733699715359136921gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr">Tyler Herrington, MSc<div>PhD Student (Climate Science)</div><div>Geography and Environmental Management</div><div>University of Waterloo</div><div><img src="https://docs.google.com/uc?export=download&id=0B3tOGC9C-gd6Mzl6TzBCSDlJdk0&revid=0B3tOGC9C-gd6K2RNL0V1Z3hUa0pOZE5oV1dmdEovUDNENEEwPQ"><br></div></div></div></div></div></div>
</div>
<br>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>