How to shade area between an upper bound and lower bound curve?

12 次查看(过去 30 天)
I have an upper bound curve comprised of vectors xmax, ymax. I also have a lower bound curve comprised of vectors xmin, ymin. The two curves do not connect to make a polygon but have the same number of elements. All four vectors are 1x361. How could I shade the area in between the curves given the upper and lower bounds? The .mat files for each vector are attached.

采纳的回答

Star Strider
Star Strider 2018-1-18
It would help to have at least a sample of your data. Without it, a guess is the best I can do.
With the monotonically-increasing x-vector in the first row, and the y-vector in the second row for each matrix, use the patch (link) function:
v = rand(1, 361);
vs = sort(v);
UpperBound = [vs; v + 3];
LowerBound = [vs; v + 1];
figure(1)
patch([UpperBound(1,:) fliplr(LowerBound(1,:))], [UpperBound(2,:) fliplr(LowerBound(2,:))], [0.1 0.5 0.9], 'EdgeColor','none')
Note: The patch function will close the curve on its own.
  4 个评论

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Contour Plots 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by