RECFIG2 10 minutes mean values of wind (dash) and direction (solid) 110 m above mean water level 24-Dec-89 at Statfjord A. Period considered for field data (horizontal solid).
Prints a caption "made by WAFO" in current figure. | |
Control axis scaling and appearance. | |
Get handle to current figure. | |
Grid lines. | |
Hold current graph. | |
Return hold state. | |
Linear plot. | |
Graphs with y tick labels on the left and right. | |
Transform polar to Cartesian coordinates. | |
Quiver plot. | |
Set object properties. | |
Square wave generation. | |
Graph title. | |
X-axis label. | |
Y-axis label. |
001 function recfig2 002 % RECFIG2 10 minutes mean values of wind (dash) and direction (solid) 003 % 110 m above mean water level 24-Dec-89 at Statfjord A. 004 % Period considered for field data (horizontal solid). 005 % 006 007 global RECFIGNUM 008 if isempty(RECFIGNUM) 009 disp('You must start recdemo in order to run this script') 010 return 011 end 012 013 global wind 014 if isempty(wind) 015 wind=load('sfa89.dat'); 016 end 017 018 ih=ishold; 019 sym='-'; 020 h=plot([17 20],34*[1 1],sym ); 021 set(h,'linewidth',2.5) 022 axis([0 24 0 40]) 023 hold on 024 h=plot([20.333333 21.33333333],34*[1 1],sym ); 025 set(h,'linewidth',2.5) 026 time= wind(:,1); 027 028 switch 1 029 case 1, %plotyy 030 031 [ax1 h11 h22]=plotyy(time,wind(:,2),time,wind(:,3)); 032 set(h11, 'LineStyle' , '--') 033 xlabel('Time (hours)') 034 ylabel('Mean wind speed (m/s)') 035 set(gcf,'currentaxes',ax1(2)) 036 ylabel('Wind direction (degrees)') 037 set(gcf,'currentaxes',ax1(1)) 038 039 case 2, % quiver plot 040 % alternative which maybe is better 041 lstep=6; % wind direction every hour 042 theta = -(90+wind(1:lstep:end,3))*pi/180; r = 2*ones(size(theta)); 043 [u,v] = pol2cart(theta,r); 044 h1=plot(time,wind(:,2));hold on 045 set(h1,'linewidth',.3) % make thinner line 046 % NB: multiply u with 35/24 to avoid axis equal 047 h2=quiver(time(1:lstep:end),wind(1:lstep:end,2),u*35/24,v,0,'filled'); % plot arrows 048 set(h2,'linewidth',1) %, set(h2(2),'linewidth',1) % set thicker line 049 h2=plot([17 20],ones(1,2)*34,'k-'); 050 set(h2,'linewidth',1.5) 051 h2=plot([20.33333, 21.33333],ones(1,2)*34,'k-'); % period considered 052 set(h2,'linewidth',1.5) 053 axis([0 25 0 35]),axis square 054 xlabel('Time (hours)') 055 ylabel('Mean wind speed (m/s)') 056 end 057 grid on 058 059 if ~ih,hold off,end 060 061 grid on 062 title('Wind conditions at Statfjord A 24 Dec. 1989') 063 wafostamp('Figure 2','(ER)') 064
Comments or corrections to the WAFO group