0

I am trying to write program to generate burndown chart. The x-axis is of dates. The y-axis shows remaining hours on a particular date. The problem is that data is not present for all the dates in advance as it is a burndown chart. So this results in error -

"ValueError: x and y must have same first dimension"

So my question is what default values I can assign to the remaining points on Y-axis? I will paste actual code if this information is not sufficient. Thanks.

Sumod
  • 3,676
  • 8
  • 46
  • 67

2 Answers2

2

I'm not sure if this is what you want, but by using masked arrays you can avoid plotting specific points. See my answer here.

Or maybe you'd like something more like this, which skips them on the x-axis as well as not plotting them?

Community
  • 1
  • 1
tom10
  • 60,398
  • 8
  • 116
  • 129
  • I think masked arrays would be an option. So I accept this answer. However, in my situation, I needed to plot two graphs, one for the burndown till (say) today and the other an ideal burn down chart till end of a milestone. So what I discovered that I can plot those two charts on the same figure, one will use a subset of x-axis values and the other will use entire x-axis. So that has solved my problem. Thanks.! – Sumod Mar 28 '12 at 22:31
1

I know this question is 2 1/2 years old, but I had a similar problem with plotting graphs with missing data and thought that masked arrays were more complex than they needed to be.

My solution was to put the numpy.inf value at any points where I was missing data and then use the 'o-' option when calling matplotlib.pyplot.plot. This will make lines be broken where you don't have data, but if you have a single data point somewhere missing data on each side of it, you get a circle.

The only downside is that you end up with circles at every point on the line, so it might not be pretty.

Sohcahtoa82
  • 549
  • 2
  • 13