.rtcContent { padding: 30px; } .lineNode {font-size: 12pt; font-family: "Times New Roman", Menlo, Monaco, Consolas, "Courier New", monospace; font-style: normal; font-weight: normal; }
% current_ timeseries
clear;clc;close all;
% 由于没有实际数据,流场构造,
% 首先流场特性,有大小有方向的矢量数据;
% 因此
time = -pi/2:pi/20:2*pi;
u1 =(5*sin(time));
v1 = (5*cos(time));
% 画图
close all
h=figure;
set(gcf,'position',[50 50 1200 650],'color','w')
axes('Position',[0.05 0.05 0.85 0.8])
axis off
M = 6;
k=6;
height=0.15;
for i = 1:M
axes('position',[0.05 0.05+(i-1)*height 0.85 height]);
f=feather(u1,v1,'-k');
N = length(u1);
for ii = 1:N
f(ii).LineWidth = 1.5;
end
xlim([-5 length(u1)+1])
if i>1
set(gca,'xtick',[1:5:length(u1)],'xticklabel',[],'xcolor','w')
box off
end
if i ==1
set(gca,'xtick',[1:5:length(u1)],'xticklabel',{'1日', '4日','8日', '12日','16日', '18日', '22日', '24日','26日', '28日', '30日'})
box off
xlabel('时间','fontsize',15,'FontWeight','bold')
end
str_y = {'表层','0.2H','0.4H','0.6H','0.8H','底层'};
set(gca,'ytick',0,'yticklabel',str_y(k),'fontsize',15,'FontWeight','bold')
k = k-1;
grid on % 添加网格线
ax = gca; % 将当前坐标区实例化
ax.GridLineStyle = '--'; % 设置网格线样式
ax.GridColor = [0,0,0]; % 设置颜色
ax.GridAlpha = 1; % 设置透明度
end
title('余流分布图','fontsize',15,'FontWeight','bold')
box off % 取消边框
ax1 = axes('Position',get(gca,'Position'),'XAxisLocation','top',...
'YAxisLocation','right','Color','none','XColor','k','YColor','k'); % 设置坐标区
set(ax1,'XTick', [],'YTick', []); % 去掉xy轴刻度
hold off
export_fig('feather.jpg')
.rtcContent { padding: 30px; } .lineNode {font-size: 12pt; font-family: "Times New Roman", Menlo, Monaco, Consolas, "Courier New", monospace; font-style: normal; font-weight: normal; }
function hh = feather(varargin)
%FEATHER Feather plot.
% FEATHER(U,V) plots the velocity vectors with components U and V as
% arrows emanating from equally spaced points along a horizontal axis.
% FEATHER is useful for displaying direction and magnitude data that
% is collected along a path.
%
% FEATHER(Z) for complex Z is the same as FEATHER(REAL(Z),IMAG(Z)).
% FEATHER(...,'LineSpec') uses the color and linestyle specification
% from 'LineSpec' (see PLOT for possibilities).
%
% FEATHER(AX,...) plots into AX instead of GCA.
%
% H = FEATHER(...) returns a vector of line handles.
%
% Example:
% theta = (-90:10:90)*pi/180; r = 2*ones(size(theta));
% [u,v] = pol2cart(theta,r);
% feather(u,v), axis equal
%
% See also COMPASS, ROSE, QUIVER.
% Charles R. Denham, MathWorks 3-20-89
% Copyright 1984-2017 MathWorks, Inc.
if nargin > 0
[varargin{:}] = convertStringsToChars(varargin{:});
end
% Parse possible Axes input
[cax, args, nargs] = axescheck(varargin{:});
if nargs < 1
error(message('MATLAB:narginchk:notEnoughInputs'));
elseif nargs > 3
error(message('MATLAB:narginchk:tooManyInputs'));
end
if nargs > 0
x = args{1};
end
if nargs > 1
y = args{2};
end
if nargs > 2
s = args{3};
end
if ischar(x)
error(message('MATLAB:feather:FirstNumericInput'));
end
xx = [0 1 NaN .8 1 .8]';
yy = [0 0 NaN .08 0 -.08].';
arrow = xx + yy .* sqrt(-1);
if nargs == 2
if ischar(y)
s = y;
x = matlab.graphics.chart.internal.datachk(x);
y = imag(x);
x = real(x);
else
s = '-';
end
elseif nargs == 1
s = '-';
x = matlab.graphics.chart.internal.datachk(x);
y = imag(x);
x = real(x);
end
if ischar(x) || ischar(y)
error(message('MATLAB:feather:LeadingNumericInputs'))
end
x = matlab.graphics.chart.internal.datachk(x);
y = matlab.graphics.chart.internal.datachk(y);
[st, co, mark, msg] = colstyle(s);
error(msg);
x = x(:);
y = y(:);
if length(x) ~= length(y)
error(message('MATLAB:feather:LengthMismatch'));
end
m = size(x, 1);
z = (x + y .* sqrt(-1)).';
a = arrow * z + ones(6, 1) * (1:m);
% Create plot
if isempty(cax) || ishghandle(cax, 'axes')
cax = newplot(cax);
parax = cax;
else
parax = cax;
cax = ancestor(cax, 'axes');
end
h = plot(real(a), imag(a), [st co mark], ...
'parent', parax);
% h = plot(real(a), imag(a), [st co mark], [1 m], [0 0], [st co mark], ...
% 'parent', parax);
if isempty(co)
co = get(cax, 'colororder');
set(h, 'color', co(1,:))
end
if nargout > 0
hh = h;
end
end