MATLAB中垂直线之间的阴影 [英] Shading between vertical lines in MATLAB

查看:32
本文介绍了MATLAB中垂直线之间的阴影的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我确定这是一个简单的问题,但我似乎无法弄清楚.我有这个情节

I'm sure this is a simple question, but I can't seem to figure it out. I've got this plot

并且我想添加垂直线并在中间区域着色以突出显示数据区域.我觉得我应该能够使用 area 函数来做到这一点,但似乎无法弄清楚.日期和值都是双精度值,并且是两个单独的向量,如果这有所不同的话.任何帮助将不胜感激.

and I want to add vertical lines and shade the area in between to highlight areas of the data. I feel like I should be able to do this using the area function, but can't seem to figure it out. The dates and values are all doubles and are two separate vectors, if that makes a difference. Any help would be greatly appreciated.

推荐答案

关于在绘图中对区域着色的非常基本的示例.对以曲线为边界的区域进行着色 也可能很有趣.

Very basic example about shading an area in a plot. Shading an area boundered by a curve might be of interest as well.

figure;
ha = area([4 6], [10 10]);
hold on
plot(1:10, 1:10,'r')
axis([1 10 1 10])
hold off

这篇关于MATLAB中垂直线之间的阴影的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆