How do I insert a placeholder in a plot where I don't have data?

9 ビュー (過去 30 日間)
Victoria Helm
Victoria Helm 2020 年 6 月 16 日
コメント済み: dpb 2020 年 6 月 17 日
I'm making a plot from two columns/variables in my data table where one of the variables is the day that the data was collected on. I want to look for trends/patterns in my data as the number of days increases. However, there are certain dates on which I did not collect any data. So I'd like to insert a place holder on the dates when no data was collected and include these in my plot. Is this possible?
  7 件のコメント
Victoria Helm
Victoria Helm 2020 年 6 月 16 日
I know how to use markers and change the x-axis ticks. I'm trying to find a way to prevent my plot from dropping off to zero on the y-axis because I'm dealing with daily data. It looks like I might need to work with a timetable rather than a data time like dbp mentioned.
dpb
dpb 2020 年 6 月 17 日
" I'm trying to find a way to prevent my plot from dropping off to zero on the y-axis..."
That's why I asked about "showing" versus "nonshowing" markers.
Use NaN or (NaT if x-axis is datetime)
It would be much easier to write actual code example if we knew what your data format looked like -- still for the purpose the timetable or a table with the time/date column as a datetime would make it drop-dead simple.

サインインしてコメントする。

回答 (1 件)

the cyclist
the cyclist 2020 年 6 月 16 日
You could use interpolation to identify where the "trend" would be at the missing data point, and plot the interpolated values as a different symbol.

カテゴリ

Help Center および File ExchangeData Type Conversion についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by