Filling between two lines

前端 未结 1 1689
梦如初夏
梦如初夏 2021-01-28 03:06

I\'ve plotted two lines based on some scattered points, however, I now need to fill the area between the two lines.

counts_dataset = dataset(\'file\',\'file.txt\         


        
相关标签:
1条回答
  • Probably you have some trouble with your data. The following code does exactly what you want:

    x = 1:10;
    y1 = sin(x) + 3;
    y2 = sin(x);
    fill([x fliplr(x)], [y2 fliplr(y1)], 'c')
    

    0 讨论(0)
提交回复
热议问题