필터 지우기
필터 지우기

Drawing a bar spanning across several dates in the x axis

조회 수: 1 (최근 30일)
Mark
Mark 2012년 9월 19일
I am trying to plot a bar chart with these characteristics:
  • The x axis is of dates
  • Each bar should span across multiple dates
  • The number of dates for each bar is the same
  • The dates of each bar do not overlap. They are consecutive
On top of the above, I want to plot, on the same figure, a plot chart with these characteristics:
  • The x axis is of dates too (same range of dates as the bar)
  • There is only one value per date in this series
I know how to plot the plot chart and the bar chart on the same figure using plotyy.
The part I am missing is how to make each bar be plotted across several dates. Currently I can only plot each bar on one date.
This example may clarify things:
  • I have a dataset of X data points. Each data point comes from 1 day. This is the plot chart I need to plot. For example, for M=30 and dates Jan-15 through Feb-15. There is one value for Jan 15, another value for Jan 16, and so on.
  • Now, a second dataset has data coming from the same time period. But instead of having a single point per date, there is one data point for periods of N days. In the same example of above, let's say N=5. There is one value for [Jan-15 through Jan-19], another value for [Jan-20 through Jan-24] and so forth. These have to be plotted as bars that span N=5 dates each. These bars don't overlap.
  • Both things have to be plotted on the same figure (no sub plots)

채택된 답변

Mark
Mark 2012년 9월 23일
I ended up using "area" plots to simulate what I wanted.
Thanks for the no help

추가 답변 (1개)

Mark
Mark 2012년 9월 20일
No one?

카테고리

Help CenterFile Exchange에서 Two y-axis에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by