[ncl-talk] Add label to gsn_csm_xy Plot

Sebastian Otarola-Bustos Sebastian.F.Otarola-Bustos.1 at nd.edu
Mon Sep 7 12:30:47 MDT 2015


Hi everyone,

I've been fighting trying to add X&Y labels to a XY plot withouts success.
I created 2 x N float array to store observed an modeled data (V10) , as
gsn_csm_xy need to work). This array was filled in with data that comes
from a float array that previously readed a .csv file with the information,
so variables doesn't have any attributes or previous information. I added
"units" attribute to *V10* and *Time* variables, which are the ones I'am
 plotting. But is still not showing the labels, any help or guidelines to
fix this would be really appreciated as always. I Attached you an image of
how it looks the current plot, and I'm showing you the plot resources and
the variables I'm working wth.


*V10 = new((/2,nlines/),float) V10(0,:) = fields_WRF(3,:)*
* V10(1,:) = fields_OBS(3,:)*

* V10 at units="m/s"*

* Times = fspan(0,nlines-1,nlines)*
* Times at units = "hours"*

* wks   = gsn_open_wks ("png","xy")*
*  res = True*
*  res at tiMainString = " Velocities at 10 m Cerrillos"*
*  ;res at tiYAxisString = V10 at units +"  "+"[solid]" ( this also didn't work)*
*  res at xyLineColors = (/"blue","red"/) ; Line colors vector*
*  res at xyLineThicknesses = (/3.0,4.0/)*
*  res at xyDashPatterns = (/0,2/) ; Line patterns vector: 0->solid ,
2->dashed*
*  res at pmLegendDisplayMode = "Always" ; Force the legend display*
*  res at xyExplicitLegendLabels = (/"WRF","Observed"/)*
*  res at lgLabelFontHeightF = 0.01*
*  res at pmLegendWidthF = 0.12 ; Legend width*
*  res at pmLegendHeightF = 0.07 ; Legend*
*  res at pmLegendParallelPosF = 0.85 ; Move legend along xaxis*
*  res at pmLegendOrthogonalPosF = -0.98 ; Move legend along yaxis*

*  plot = gsn_csm_xy (wks,Times,V10,res )*



All the best,
Thank you in advance,
Sebastián.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150907/b85c2fac/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: xy_3.png
Type: image/png
Size: 72817 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150907/b85c2fac/attachment.png 


More information about the ncl-talk mailing list