用 Bold Plot 填充 MatLab 中三条曲线之间的区域
Filling the area between three curves in MatLab with Bold Plot
我正在尝试制作类似于下图的图表:
我有图形下限、中值(粗线)和上限的图。我尝试使用填充,但它似乎创建了奇怪的填充多边形。另外,我怎样才能使中值图加粗?
谢谢。
编辑:这是一个 MWE 试图为曲线 y=1/x 绘制这样的图。
x=1:1:20
y1 = 1./x
y2 = 1./x-2
y3 = 1./x+2
fill(x,y2,'b',x,y1,'b',x,y3,'b')
shadedplot.m 非常适合这样的应用程序。
试试这个:
shadedplot(x, y2, y3, [0.8 0.8 1], [0.8 0.8 1])
hold on
plot(x, y1, 'Color', [0.3 0.3 0.8], 'Linewidth', 3)
我正在尝试制作类似于下图的图表:
我有图形下限、中值(粗线)和上限的图。我尝试使用填充,但它似乎创建了奇怪的填充多边形。另外,我怎样才能使中值图加粗?
谢谢。
编辑:这是一个 MWE 试图为曲线 y=1/x 绘制这样的图。
x=1:1:20
y1 = 1./x
y2 = 1./x-2
y3 = 1./x+2
fill(x,y2,'b',x,y1,'b',x,y3,'b')
shadedplot.m 非常适合这样的应用程序。
试试这个:
shadedplot(x, y2, y3, [0.8 0.8 1], [0.8 0.8 1])
hold on
plot(x, y1, 'Color', [0.3 0.3 0.8], 'Linewidth', 3)