TA的每日心情 | 开心 2019-11-19 15:19 |
---|
签到天数: 1 天 [LV.1]初来乍到
|
因为fill填充的是一个封闭图形,你给出的点全在曲线上所以填充的就是曲线首尾衔接的图形了,想填充类似扇形的区域,需要自己额外补充上扇形的圆心坐标,举个例子8 r: \$ ~ H& {+ T3 X
- N = 20;
- x = linspace(-20,0,N).';
- F = -exp(-2*x/11);
- figure;
- subplot(121)
- plot(x,F,'k','LineWidth',2)
- hold on
- fill(x,F,'b','facealpha',0.2,'edgealpha',0)
- subplot(122)
- plot(x,F,'k','LineWidth',2)
- hold on
- fill([max(x);x],[min(F);F],'b','facealpha',0.2,'edgealpha',0)
9 R( u5 e- s% n+ x) P6 w3 F0 n
' y* o2 Y0 j/ Y; v
; e$ h' m) V* g$ P# M. R
|
|