图 Matlab:标题消失

Figure Matlab: title desappears

执行时:

x=1:100;
figure(1)
title('Sobel software execution scalability')

我获得:

但是,当我绘制一些东西时,例如执行:

x=1:100;
figure(1)
title('Sobel software execution scalability')
plot(x)

结果是另一个:

图有但标题不见了。我做错了什么?

我找到的解决方案是添加 hold on:

x=1:100;
figure(1)
title('Sobel software execution scalability')
hold on
plot(x)

但这听起来真的很奇怪。我可能需要一直添加 hold on 吗?如果我需要更改图形运行时间怎么办??

Note that these few lines were written just for you to replicate the error on your host machine.

答案是:在情节之后打印标题。否则,绘图将覆盖之前图形上的内容。