【问题标题】:Set y axis limits matlab plot设置 y 轴范围 matlab 图
【发布时间】:2014-10-20 09:16:13
【问题描述】:

我有以下正态分布,我需要在 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);

谁能告诉我怎么做?问候

【问题讨论】:

标签: matlab graph normal-distribution


【解决方案1】:

axis 函数是您需要的。

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

axis([xmin xmax ymin ymax])

或者您可以使用它来做以下事情:

axis equal
axis tight
axis off

更多信息请查看文档:

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

【讨论】:

  • 我无法将 y sup 限制设置为 1.5。它自动设置为 1。
【解决方案2】:

试试这个,

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

【讨论】:

  • 我没有看到@zinjaai 的评论。
猜你喜欢
  • 2018-10-09
  • 2011-11-06
  • 2015-11-17
  • 1970-01-01
  • 2019-09-06
  • 1970-01-01
  • 1970-01-01
  • 2019-07-07
  • 2014-02-27
相关资源
最近更新 更多