设置y轴限制matlab图

use*_*311 1 matlab graph normal-distribution

我有以下正态分布,我需要在y轴上将图形图设置为1.5.

x = -.5:0.0001:3.5;
m1 = 1;
s1 = 0.5;
pdfNormal_1 = normpdf(x, m1, s1);
ylim([0 1.5])
set(gcf,'color','w');
plot(x, pdfNormal_1)%, x, pdfNormal_2);
Run Code Online (Sandbox Code Playgroud)

有人能告诉我怎么做?问候

And*_*uri 5

axis功能是您需要的功能.

您可以将轴设置为您想要使用的值

axis([xmin xmax ymin ymax])
Run Code Online (Sandbox Code Playgroud)

或者你可以玩它做的事情:

axis equal
axis tight
axis off
Run Code Online (Sandbox Code Playgroud)

等等

转到文档以获取更多信息:

http://www.mathworks.co.uk/help/matlab/ref/axis.html?refresh=true