<div dir="ltr">Hi Ruksana,<div>If all you want is 3 different spectra overlaid on the same plot you could use the overlay procedure. You will need to tell NCL to not draw the plot nor advance the frame before creating the 3 spectra. You may also need to set trYMaxF if portions of one spectra go off the plot.</div><div><br></div><div>Here&#39;s an example:</div><div>res@gsnDraw = False</div><div>res@gsnFrame = False</div><div><span style="font-size:12.8px">res@xyLineColor = &quot;green&quot;</span></div><div><span style="font-size:12.8px">plot=gsn_csm_xy(wks,spec@frq,s</span><wbr style="font-size:12.8px"><span style="font-size:12.8px">pec@spcx,res)     ; create plot   </span><br></div><div>res@xyLineColor = &quot;black&quot;</div><div>plot2 = <span style="font-size:12.8px">gsn_csm_xy(wks,spec2@frq,s</span><wbr style="font-size:12.8px"><span style="font-size:12.8px">pec2@spcx,res)     ; create plot   </span> </div><div><div>res@xyLineColor = &quot;blue&quot;</div><div>plot3 = <span style="font-size:12.8px">gsn_csm_xy(wks,spec3@frq,s</span><wbr style="font-size:12.8px"><span style="font-size:12.8px">pec3@spcx,res)     ; create plot</span></div><div><span style="font-size:12.8px">overlay(plot,plot2)</span></div><div><span style="font-size:12.8px">overlay(plot,plot3)</span></div><div><span style="font-size:12.8px">draw(plot)</span></div><div><span style="font-size:12.8px">frame(wks)</span></div><div><span style="font-size:12.8px">  </span></div></div><div><span style="font-size:12.8px">Hope that helps. If not, please respond to the ncl-talk email list.</span></div><div><span style="font-size:12.8px">Adam</span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Dec 5, 2016 at 12:09 PM, Ruksana Abedin <span dir="ltr">&lt;<a href="mailto:ruksana.abedin@gmail.com" target="_blank">ruksana.abedin@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><div><div><div>Hi,<br><br></div>I could figure the required process out. This time followed the example 4 at <a href="http://www.ncl.ucar.edu/Applications/Scripts/spec_4.ncl" target="_blank">http://www.ncl.ucar.edu/<wbr>Applications/Scripts/spec_4.<wbr>ncl</a>. However, I would still like to know how can I plot three spectrums of three colours in one single plot. Your help is always useful.<br><br></div>Thank you for putting up wonderful resources.<br><br></div>Best regards,<br></div>Ruksana <br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Dec 5, 2016 at 5:30 PM, Ruksana Abedin <span dir="ltr">&lt;<a href="mailto:ruksana.abedin@gmail.com" target="_blank">ruksana.abedin@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">

<p class="MsoNormal">Hi,</p>

<p class="MsoNormal"> </p>

<p class="MsoNormal">I have followed the
<a href="http://www.ncl.ucar.edu/Applications/Scripts/spec_1.ncl" target="_blank">http://www.ncl.ucar.edu/Applic<wbr>ations/Scripts/spec_1.ncl</a> script to plot a
spectrum for my data but the specs are very difficult to visualize clearly in
the plot. Data is daily precipitation from model and two observations for 1988-2007.  <br></p><p class="MsoNormal"><br></p><p class="MsoNormal">1. How to change the x and y axis scales to make it
more visible. <br></p><p class="MsoNormal">2. Can I have the cycles per day instead of months? How to
change this aspect? <br></p><p class="MsoNormal">3. Can I plot three spectrums for three different files in a panel together?<br></p>

<p class="MsoNormal"><br></p><p class="MsoNormal">The variable summary, script and the resultant plot are attached.
Your time and efforts to help me out is highly appreciated.<span>  <br></span></p><p class="MsoNormal"><span><br></span></p><p class="MsoNormal"><span><br></span></p><p class="MsoNormal"><span>Variable: PPT_mod<br>Type: float<br>Total Size: 25056000 bytes<br>            6264000 values<br>Number of Dimensions: 3<br>Dimensions and sizes:   [time | 7200] x [lat | 30] x [lon | 29]<br>Coordinates:<br>            time: [52950.5..60149.5]<br>            lat: [15.25..29.75]<br>            lon: [  83..  97]<br>Number Of Attributes: 10<br>  z1 :   0<br>  standard_name :       precipitation_flux<br>  long_name :   TOTAL PRECIPITATION RATE KG/M2/S<br>  units :       kg m-2 s-1<br>  _FillValue :  1e+20<br>  missing_value :       1e+20<br>  stash_item :  216<br>  stash_section :       5<br>  field_code :  90<br>  cell_method : time: mean<br><br>Variable: PPT_obs1<br>Type: float<br>Total Size: 25056000 bytes<br>            6264000 values<br>Number of Dimensions: 3<br>Dimensions and sizes:   [time | 7200] x [lat | 30] x [lon | 29]<br>Coordinates:<br>            time: [19880101.5..20071230.5]<br>            lat: [15.25..29.75]<br>            lon: [  83..  97]<br>Number Of Attributes: 5<br>  long_name :   daily precipitation analysis interpolated onto 0.5deg grids [mm/day]<br>  units :       mm/day<br>  _FillValue :  -99.9<br>  missing_value :       -99.9<br>  level_description :   Earth surface<br><br></span></p><p class="MsoNormal"><span>Variable: PPT_obs2<br>Type: float<br>Total Size: 25056000 bytes<br>            6264000 values<br>Number of Dimensions: 3<br>Dimensions and sizes:   [time | 7200] x [lat | 30] x [lon | 29]<br>Coordinates:<br>            time: [19880101.5..20071230.5]<br>            lat: [15.25..29.75]<br>            lon: [  83..  97]<br>Number Of Attributes: 5<br>  long_name :   full data daily product version 1 precipitation per grid<br>  units :       mm/day<br>  code :        20<br>  _FillValue :  -99999.99<br>  missing_value :       -99999.99</span></p><p class="MsoNormal"><span><br></span></p><p class="MsoNormal"><span><br>;*****************************<wbr>*******************<br>begin<br>;*****************************<wbr>************************ <br>;read in data <br>;*****************************<wbr>************************ <br>f0 = addfile (&quot;/../1WAH_daily_precip_b387cl<wbr>im_Bangladesh_100_1988_<a href="http://2007_land_only.nc" target="_blank">2007_<wbr>land_only.nc</a>&quot;, &quot;r&quot;);<br>f1 = addfile(&quot;/../APHRO_1988_2007_<a href="http://correct_daily_precip.nc" target="_blank">c<wbr>orrect_daily_precip.nc</a>&quot;, &quot;r&quot;)<br>f2 = addfile(&quot;/../GPCC_1988_2007_<a href="http://correct_daily_precip.nc" target="_blank">co<wbr>rrect_daily_precip.nc</a>&quot;,&quot;r&quot;)<br><br>;*****************************<wbr>************************ <br>; parameters<br>;*****************************<wbr>************************ <br><br>PPT_mod = f0-&gt;precip(:,0,:,:)<br>PPT_mod = PPT_mod*60*60*24<br>PPT_obs1 = f1-&gt;precip<br>PPT_obs2 = f2-&gt;precip<br><br>fldmean0 = wgt_areaave_Wrap(PPT_mod,1.0,1<wbr>.0,1)<br>fldmean1 = wgt_areaave_Wrap(PPT_obs1,1.0,<wbr>1.0,1)<br>fldmean2= wgt_areaave_Wrap(PPT_obs2,1.0,<wbr>1.0,1)<br><br>;printVarSummary(time)<br><br>printVarSummary(PPT_mod)<br>printVarSummary(PPT_obs1)<br>printVarSummary(PPT_obs2)<br><br>;*****************************<wbr>*******************<br>; set function arguments<br>;*****************************<wbr>*******************<br>; detrending opt: 0=&gt;remove mean 1=&gt;remove mean and detrend<br>  d = 0<br>; smoothing periodogram: (0 &lt;= sm &lt;= ??.) should be at least 3 and odd<br>  sm = 7<br>; percent tapered: (0.0 &lt;= pct &lt;= 1.0) 0.10 common. <br>  pct = 0.10<br>;*****************************<wbr>*******************<br>; calculate spectrum<br>;*****************************<wbr>*******************<br>  spec = specx_anal(fldmean2,d,sm,pct)<br>;*****************************<wbr>*******************<br>; plotting<br>;*****************************<wbr>*******************<br>   wks  = gsn_open_wks(&quot;eps&quot;,&quot;spec&quot;)    <wbr>            ; Opens a eps file <br><br>   res = True                       ; no plot mods desired<br>   res@tiMainString = &quot;Precipitation&quot;                   ; title<br>   res@tiXAxisString = &quot;Frequency (cycles/month)&quot;  ; xaxis<br>   res@tiYAxisString = &quot;Variance&quot;                  ; yaxis<br><br>   plot=gsn_csm_xy(wks,spec@frq,s<wbr>pec@spcx,res)     ; create plot   <br>;*****************************<wbr>******************<br>end<br></span></p><p class="MsoNormal"><span><br></span></p>

</div>
</blockquote></div><br></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><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="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>