<div dir="ltr"><div><div>Hi Tabish,<br></div>The data array that you are passing in is dimensioned 49 x49. I think you want that to be dimensioned 2 x 49. Change this:<br><font face="trebuchet ms, sans-serif" color="#666666" size="2">data = new((/49,49/),&quot;float&quot;)<br></font></div><font face="trebuchet ms, sans-serif" color="#666666" size="2">to this:</font><br><font face="trebuchet ms, sans-serif" color="#666666" size="2">data = new((/2,49/),&quot;float&quot;)</font><div><br></div><div>(If you do not do that you will get 49 labeled legend lines.)<br></div><div><br></div><div>If that doesn&#39;t solve your issue or if you have further questions please respond to ncl-talk.<br></div><div>Adam<br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Aug 27, 2015 at 9:54 AM, Tabish Ansari <span dir="ltr">&lt;<a href="mailto:tabishumaransari@gmail.com" target="_blank">tabishumaransari@gmail.com</a>&gt;</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 class="gmail_default" style="font-family:trebuchet ms,sans-serif">Hi<br><br></div><div>I am using the following script:<font face="trebuchet ms, sans-serif" color="#666666" size="2"><br><br><div class="gmail_default" style="font-family:trebuchet ms,sans-serif;display:inline">​load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl&quot;<br>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl&quot;<br><br>begin<br> a     = addfile (&quot;<a href="http://consolidated_d04.nc" target="_blank">consolidated_d04.nc</a>&quot;,&quot;r&quot;)<br> wks   = gsn_open_wks (&quot;x11&quot;,&quot;xy&quot;)                ; open workstation<br> res                  = True                     ; plot mods desired<br> res@tiMainString     = &quot;PM2.5 at Mandir Marg&quot;          ; add title<br>res@xyLineColors      = (/&quot;blue&quot;,&quot;red&quot;/)          ; change line color<br>res@xyDashPattern = 0               ; Make curves all solid<br>res@xyLineThicknesses = (/2.0,2.0/)               ; make 2nd lines thicker<br>res@pmLegendDisplayMode    = &quot;Always&quot;            ; turn on legend<br>res@xyExplicitLegendLabels = (/&quot;Sim.&quot;,&quot;Obs.&quot;/)         ; create explicit labels<br><br>time = fspan(0, 48, 49)<br>data = new((/49,49/),&quot;float&quot;)<br>PM25_sim = a-&gt;PM25(:,0,38,37)<br>PM25_obs = asciiread(&quot;PM2_5_MM.txt&quot;,(/49/),&quot;float&quot;)<br>data(0,:)= PM25_sim<br>data(1,:)= PM25_obs<br> plot  = gsn_csm_xy (wks,time,data,res) ; create plot<br>end<br><br><span style="color:rgb(0,0,0)"><span style="font-family:arial,helvetica,sans-serif"><br></span></span></div><div class="gmail_default" style="display:inline"><span style="color:rgb(0,0,0)"><span style="font-family:arial,helvetica,sans-serif">However, I ​</span></span></div><div class="gmail_default" style="display:inline"><span style="color:rgb(0,0,0)"><span style="font-family:arial,helvetica,sans-serif">​am not getting the desired legend names.<br><br></span></span></div><div class="gmail_default" style="display:inline"><span style="color:rgb(0,0,0)"><span style="font-family:arial,helvetica,sans-serif">Please help me out<br><br></span></span></div><div class="gmail_default" style="display:inline"><span style="color:rgb(0,0,0)"><span style="font-family:arial,helvetica,sans-serif">Thanks a lot<br><br></span></span></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif;display:inline"><span style="color:rgb(0,0,0)"><span style="font-family:arial,helvetica,sans-serif">Tabish</span></span>​</div><br><br><br><br>Tabish U Ansari<br>IBM Research India Laboratory<br></font></div><div><div><div dir="ltr"><div><div dir="ltr"><div><div><font face="trebuchet ms, sans-serif" color="#666666" size="2">New Delhi<br></font></div></div></div></div></div></div></div>
</div>
<br>_______________________________________________<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/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div><div><span><font color="#888888">Adam Phillips <br></font></span></div><span><font color="#888888">Associate Scientist,  </font></span><span><font color="#888888">Climate and Global Dynamics Laboratory, NCAR<br></font></span></div></div><div><span><font color="#888888"><a href="http://www.cgd.ucar.edu/staff/asphilli/" target="_blank">www.cgd.ucar.edu/staff/asphilli/</a>   </font></span><span><font color="#888888">303-497-1726 </font></span></div><span><font color="#888888"></font></span><div><div><span><font color="#888888"><br></font></span><div><span><font color="#888888"><a href="http://www.cgd.ucar.edu/staff/asphilli" target="_blank"></a></font></span></div></div></div></div></div></div></div></div></div></div></div>
</div>