<div dir="ltr"><div>[1] The script you sent should *not* work at all. It looks like you caut and pasted from several different<br></div><div>     example scripts and expected it to work.<br><br></div><div>[2] If it did work, you would not have &quot;annual means&quot;. .... yould would have &quot;anomalies&quot;<br>           x_ave = rmMonAnnCycTLL(x)<br></div><div>           would not create an &quot;ave&quot; (average). It creates &quot;anomalies&quot; from an average<br><br></div><div>[3] The following would also fail<br>           data1(1,:) = rc*(x-rc@xave) + rc@yave</div><div><br></div><div>You sent<br></div><div>==<br><div>x_ave = rmMonAnnCycTLL(x)<br>
y        = rmMonAnnCycTLL(y)<br><br></div><div>Then you use &#39;y_ave&#39; which you have not created.<br></div>

<div> </div>



<div>x_ave_new = dim_avg_n(x_ave,(/1,2/))</div>

<div>y_ave_new = dim_avg_n(y_ave,(/1,2/))   ; &lt;== you have not computed y_ave<br><br></div><div>The script should fail here.<br>==<br><br></div><div>Assuming, <br><br>    y = rmMonAnnCycTLL(y)<br><br></div><div>should be<br><br>   y_ave = rmMonAnnCycTLL(y)<br><br>==<br></div>Now you use<br><br></div><div><div><div>x_ave_new = dim_avg_n(x_ave,(/1,2/))   ; ===&gt;    x_ave_new(ntim)</div>

<div>y_ave_new = dim_avg_n(y_ave,(/1,2/))   ; ===&gt;    y_ave_new(ntim)<br><br></div><div>rc = regline(x_ave_new,y_ave_new)</div>

<div>print(rc)<br><br></div>





<div>x = x_ave_new                ; &lt;*******   this should fail here <br>
y = y_ave_new</div>

<div>data1 = new((/2,dimsizes(y)/), typeof(y))<br><br><div>By default, NCL does not allow a one-dimensional array [ x_ave_new,   y_ave_new ]<br></div><div>to overwrite a three-dimensional array [ x(ntim,nlat,mlon), y(ntim,nlat,mlon) ]<br></div>unless special NCL syntax := is used. This syntax is available from 6.1.1 onward.<br><br></div>Please clean up your script and send something that &#39;kinda&#39; works.<br></div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Sep 12, 2014 at 6:07 AM, Lena Frey <span dir="ltr">&lt;<a href="mailto:Frey_L@web.de" target="_blank">Frey_L@web.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="font-family:Verdana;font-size:12.0px"><div>Hi all!</div>

<div> </div>

<div>I am trying to make as scatter plot. I have monthly data, the dimensions of the variables x and y are time,lat,lon.</div>

<div>I would like to have scatter plots for different regions and to have monthly data de-seasonalized.</div>

<div>The script is working, but it seems like I have annual means.</div>

<div>Here is my script:</div>

<div> </div>

<div>
<div>in_x = addfile(&quot;~/DATA/<a href="http://x.nc" target="_blank">x.nc</a>&quot;,&quot;r&quot;)<br>
x = in_x-&gt;x(:,{-10:-20},{180:190})</div>

<div>in_y = addfile(&quot;~/DATA/<a href="http://y.nc" target="_blank">y.nc</a>&quot;,&quot;r&quot;)<br>
y = in_y-&gt;y(:,{-10:-20},{180:190})</div>

<div> </div>
;*********************************************************************************

<div>; remove annual cycle<br>
;*********************************************************************************</div>

<div>x_ave = rmMonAnnCycTLL(x)<br>
y = rmMonAnnCycTLL(y)</div>

<div> </div>

<div>;********************************************************************************<br>
; calculate average LON LAT<br>
;********************************************************************************</div>

<div>x_ave_new = dim_avg_n(x_ave,(/1,2/))</div>

<div>y_ave_new = dim_avg_n(y_ave,(/1,2/))</div>

<div> </div>

<div>;********************************************************************************<br>
; regression line<br>
;********************************************************************************</div>

<div>rc = regline(x_ave_new,y_ave_new)</div>

<div>print(rc)</div>

<div> </div>

<div>;********************************************************************************<br>
; create array<br>
;********************************************************************************</div>

<div>x = x_ave_new<br>
y = y_ave_new</div>

<div>data1 = new((/2,dimsizes(y)/), typeof(y))</div>

<div><br>
data1(0,:) = y</div>

<div>data1(1,:) = rc*(x-rc@xave) + rc@yave</div>

<div> </div>

<div> </div>

<div><br>
;*********************************************************************************<br>
; plotting parameters<br>
;*********************************************************************************</div>

<div>wks = gsn_open_wks(&quot;pdf&quot;,&quot;scatter&quot;)</div>

<div>res                 = True<br>
;res@gsnMinimize            = True</div>

<div>...</div>

<div> </div>

<div>plot = gsn_csm_xy (wks,x,data1,res)</div>

<div> </div>

<div>end</div>

<div>;********************************************************************</div>

<div> </div>

<div> </div>

<div>Thanks.</div>

<div>Best regards,</div>

<div>Lena</div>
</div></div></div>
<br>_______________________________________________<br>
ncl-talk mailing list<br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>