<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif;color:rgb(69,129,142)">Hi</div><div class="gmail_default" style="font-family:verdana,sans-serif;color:rgb(69,129,142)"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;color:rgb(69,129,142)">
I have 2 matrices of say 100x100 elements. I wish to find the correlation between the corresponding elements of each matrix. I understand that there will be total 10,000 datapoints to be plotted. (like a(i,j) vs b(i,j))</div>
<div class="gmail_default" style="font-family:verdana,sans-serif;color:rgb(69,129,142)"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;color:rgb(69,129,142)">I am trying to first convert both the 2d arrays to 1d arrays and then use the function gsn_csm_xy</div>
<div class="gmail_default" style="font-family:verdana,sans-serif;color:rgb(69,129,142)"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;color:rgb(69,129,142)">However, I am not getting the desired plot. Please help me with this.</div>
<div class="gmail_default" style="font-family:verdana,sans-serif;color:rgb(69,129,142)"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;color:rgb(69,129,142)">Pasted below is the draft script I am trying:</div>
<div class="gmail_default" style="font-family:verdana,sans-serif;color:rgb(69,129,142)"><br></div><div class="gmail_default"><div class="gmail_default"><font face="times new roman, serif" color="#000000">; ***********************************************</font></div>
<div class="gmail_default"><font face="times new roman, serif" color="#000000">; correlation.ncl</font></div><div class="gmail_default"><font face="times new roman, serif" color="#000000">;</font></div><div class="gmail_default">
<font face="times new roman, serif" color="#000000">; Concepts illustrated:</font></div><div class="gmail_default"><font face="times new roman, serif" color="#000000">; - Drawing a black-and-white XY plot</font></div><div class="gmail_default">
<font face="times new roman, serif" color="#000000">;</font></div><div class="gmail_default"><font face="times new roman, serif" color="#000000">;************************************************</font></div><div class="gmail_default">
<font face="times new roman, serif" color="#000000">load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"</font></div><div class="gmail_default"><font face="times new roman, serif" color="#000000">load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"</font></div>
<div class="gmail_default"><font face="times new roman, serif" color="#000000">;************************************************</font></div><div class="gmail_default"><font face="times new roman, serif" color="#000000">begin</font></div>
<div class="gmail_default"><font face="times new roman, serif" color="#000000">;************************************************</font></div><div class="gmail_default"><font face="times new roman, serif" color="#000000">; read in data</font></div>
<div class="gmail_default"><font face="times new roman, serif" color="#000000">;************************************************</font></div><div class="gmail_default"><font face="times new roman, serif" color="#000000"> a = addfile ("../<a href="http://wrfout_d01.nc">wrfout_d01.nc</a>","r")</font></div>
<div class="gmail_default"><font face="times new roman, serif" color="#000000"> b = addfile ("../<a href="http://wrfchemi.nc">wrfchemi.nc</a>","r")</font></div><div class="gmail_default"><font face="times new roman, serif" color="#000000"><br>
</font></div><div class="gmail_default"><font face="times new roman, serif" color="#000000"> x = a->co(0,0,:,:)</font></div><div class="gmail_default"><font face="times new roman, serif" color="#000000"> y = b->E_CO(0,0,:,:)</font></div>
<div class="gmail_default"><font face="times new roman, serif" color="#000000"><br></font></div><div class="gmail_default"><font face="times new roman, serif" color="#000000"> x1 = ndtooned(x)</font></div><div class="gmail_default">
<font face="times new roman, serif" color="#000000"> y1 = ndtooned(y)</font></div><div class="gmail_default"><font face="times new roman, serif" color="#000000">;************************************************</font></div>
<div class="gmail_default"><font face="times new roman, serif" color="#000000">; plotting parameters</font></div><div class="gmail_default"><font face="times new roman, serif" color="#000000">;************************************************</font></div>
<div class="gmail_default"><font face="times new roman, serif" color="#000000"> wks = gsn_open_wks ("x11","correlation") ; open workstation</font></div><div class="gmail_default"><font face="times new roman, serif" color="#000000"><br>
</font></div><div class="gmail_default"><font face="times new roman, serif" color="#000000"> res = True ; plot mods desired</font></div><div class="gmail_default"><font face="times new roman, serif" color="#000000"> res@tiMainString = "Basic XY plot" ; add title</font></div>
<div class="gmail_default"><font face="times new roman, serif" color="#000000"><br></font></div><div class="gmail_default"><font face="times new roman, serif" color="#000000"> plot = gsn_csm_xy (wks,x1,y1,res) ; create plot</font></div>
<div class="gmail_default"><font face="times new roman, serif" color="#000000">end</font></div></div><div><br></div>-- <br><div dir="ltr"><font size="1" face="verdana, sans-serif" color="#073763">Thanks & Regards<br>Tabish Umar Ansari</font><div>
<font size="1" face="verdana, sans-serif" color="#073763">MS Research Scholar<br>Environmental & Water Resources Engineering Division</font></div><div><font size="1" face="verdana, sans-serif" color="#073763">Department of Civil Engineering</font></div>
<div><font size="1" face="verdana, sans-serif" color="#073763">IIT Madras</font></div></div>
</div>