[ncl-talk] Add label to gsn_csm_xy Plot

Sebastian Otarola-Bustos Sebastian.F.Otarola-Bustos.1 at nd.edu
Mon Sep 7 13:29:44 MDT 2015


Thank you very much, I followed your suggestion and it worked fine.

All the best,
Sebastián.

On Mon, Sep 7, 2015 at 4:15 PM, Alan Brammer <abrammer at albany.edu> wrote:

> *res at tiYAxisString = V10 at units +"  "+"[solid]"*
> *res at tiXAxisString ="Some X Axis String"*
> should do the job.
>
> You shouldn't need to but you could also try setting
> res at tiXAxisOn = True
> res at tiYAxisOn = True
>
> I added those two lines to your resources and got x and y titles.
>
>
> Good luck.
> Alan.
>
>
>
>
> On Mon, Sep 7, 2015 at 2:30 PM, Sebastian Otarola-Bustos <
> Sebastian.F.Otarola-Bustos.1 at nd.edu> wrote:
>
>> 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.
>>
>>
>>
>>
>>
>>
>>
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk at ucar.edu
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150907/fa2b79aa/attachment.html 


More information about the ncl-talk mailing list