如何设置不同的轴值?
3次浏览(过去30天)
显示旧的注释
我想改变等高线图中的轴显示值。
Xylim = 0.0055;
N = 5;x = linspace(-xylim,xylim,N);Y = x;
[X,Y] = meshgrid(X,Y);
r = (x ^2 + y ^2);Rho =√(r);
F = 0.011;
Theta = atan(rho./f);
CPhi = x /;SPhi = Y./rho;
如果mod(N,2) == 1
CPhi((N-1)/2+1,(N-1)/2+1) = 1;
SPhi((N-1)/2+1,(N-1)/2+1) = 0;
结束
% %功能
N1 = 1;
N2 = 1.5;
thetaI =;
Th = theta*180/;
thetaT = asin((n1./n2).*sin(thetaI));
CTi = cos(thetaI);
CTt = cos(thetaT);
A = (n2。*CTi - n1.*CTt);
B = (n2。*CTi + n1.*CTt);
C = (n1;*CTi - n2.*CTt);
D = (n1;*CTi + n2.*CTt);
Rp = a /b;
Rs = c./d;
图中,contourf (X, Y, Rp, 20);
现在x轴和y轴的值为-5到+5毫米,从下图中我们可以看到。我想将轴值从X和Y更改为Th值图(下图)的红色十字线的值,它是X和Y的函数。因此新的X轴应该是[26.5651 14.0362 0 140362 26.5651},新的Y轴应该是[26.5651 14.0362 0 140362 26.5651}。有人能帮帮我吗?谢谢你!
0评论
接受的答案
凯文·霍利
2023年2月14日
Xylim = 0.0055;
N = 5;x = linspace(-xylim,xylim,N);Y = x;
[X,Y] = meshgrid(X,Y);
r = (x ^2 + y ^2);Rho =√(r);
F = 0.011;
Theta = atan(rho./f);
CPhi = x /;SPhi = Y./rho;
如果mod(N,2) == 1
CPhi((N-1)/2+1,(N-1)/2+1) = 1;
SPhi((N-1)/2+1,(N-1)/2+1) = 0;
结束
% %功能
N1 = 1;
N2 = 1.5;
thetaI =;
Th = theta*180/;
thetaT = asin((n1./n2).*sin(thetaI));
CTi = cos(thetaI);
CTt = cos(thetaT);
A = (n2。*CTi - n1.*CTt);
B = (n2。*CTi + n1.*CTt);
C = (n1;*CTi - n2.*CTt);
D = (n1;*CTi + n2.*CTt);
Rp = a /b;
Rs = c./d;
图中,contourf (X, Y, Rp, 20);
甘氨胆酸h =;
% X轴
h.XTick = [-0.0055,-0.0028,0,0.0028,0.0055];
Newx = [26.5651 14.0362 0 140362 26.5651];
h.XAxis.TickLabels = {newx};
% Y轴
h.YTick = [-0.0055,-0.0028,0,0.0028,0.0055];
Newy = [26.5651 14.0362 0 140362 26.5651];
. yaxis . ticklabels = {newx};