PDA

View Full Version : Drawing Simple Bar Charts (Stats Question)

Davros
11-10-2004, 06:47 AM
Hi there,

I'm writing a small program to draw bar and pie charts. I have a question regarding weights (or frequencies) of values.

If I have the following data:

VAL FREQ
5 1
2 1
3 2*
4 1

Typically, what do I plot for the bar of the third value?

Do I plot a single bar of height 6, or two bars of height 3?

If I were two plot two separate bars, what would I plot if the frequency was a fractional number?

Thanks

Govtcheez
11-10-2004, 07:01 AM
> Do I plot a single bar of height 6, or two bars of height 3?

I'd do 2 of height 3. Having one of height 6 doesn't make much sense

> If I were two plot two separate bars, what would I plot if the frequency was a fractional number?

I don't follow.

Davros
11-10-2004, 07:08 AM
>I don't follow

If the third value had a non-integer weight of 2.5, then I can't plot 2 and a half bars.

Or does my question simply not make sense because no one would ever enter a non-integer weight? In which case, should I simply round to the nearest integer and stop worrying?

Govtcheez
11-10-2004, 07:12 AM
That's kinda what I meant. Seems it'd be difficult to have a non-integer weight. Even if you did, you could change the proportions so it does.

IE

VAL FREQ
5 1
2 1
3 2.5
4 1

VAL FREQ
5 2
2 2
3 5
4 2I hate stats, though, so I don't know if this would cause more problems than it solved. You could also put some sort of a note on that, but that's really up to you.

Davros
11-10-2004, 07:23 AM
>I hate stats

They certainly make you think.

I think I'll split non-unity weights into multiple bars, while rounding to the integer. Unless, of course, someone can suggest why plotting weighted values on the y-axis would be useful. At the moment, I agree that it doesn't seem to make any sense.

Thenks for replyling Govtcheez. That helped!