MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   资料存档 (https://www.labfans.com/bbs/forumdisplay.php?f=72)
-   -   如何在MATLAB中的线下为图形的一部分上色? (https://www.labfans.com/bbs/showthread.php?t=22833)

poster 2019-12-10 16:49

如何在MATLAB中的线下为图形的一部分上色?
 
我想在同一幅图中绘制一条线图,并在彩色线(置信区间)下绘制一部分图形。

如何在MATLAB中执行此操作?

我已经尝试了以下方法,但是它不起作用(仅显示该区域):

plot(theta, p_prior_cum) area(theta(50:70), p_prior_cum(50:70)) axis([0 1 0 1])
回答:
您需要使用释抑并按住以保留图中的当前图形。

像这样:

hold on plot(theta, p_prior_cum) area(theta(50:70), p_prior_cum(50:70)) axis([0 1 0 1]) hold off [URL="http://www.mathworks.com/help/techdoc/ref/hold.html"]这是一个更详尽地描述用法的链接[/URL]



[url=https://stackoverflow.com/questions/1577547]更多&回答...[/url]


所有时间均为北京时间。现在的时间是 23:17

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.