Matlab
复制代码
close all; clear; clc
% Line width, maker size, font size, font name
lw = 1.0;
ms = 4.0;
fs = 12.0;
fn = 'Times New Roman';
% x=y/b0; y1=u/V_J; y2=y3=p/0.5*rho*gh
y1 = linspace(0, 1.0, 100);
x = 2/pi*(atan(y1)+atanh(y1))
y2 = exp(-pi*x.^2/4);
y3 = 1-y1.^2
figure(1);
plot(x, y1, 'k-', x, y2, 'r--', x, y3, 'g-')
xlabel('$y/b_0$','Interpreter', 'latex','fontsize',fs);
ylabel('$u/V_J$ and $p/\frac{1}{2}\rho V_J^2$','Interpreter','latex','fontsize',fs);
xlim([0 1.6])
ylim([0 1.0])
set(gca,'xTick',[0:0.2:1.6])
set(gca,'yTick',[0:0.2:1.0])
set(gca,'xticklabel',sprintf('%2.1f\n',get(gca,'xtick')));
set(gca,'yticklabel',sprintf('%2.1f\n',get(gca,'ytick')));
set(gca, 'YDir', 'reverse');
% h3=legend('{\itA}','{\itB}','{\itC}','Location','NorthEast');
% set(h3,'fontsize',fs,'fontname',fn);
box on