Histogram inconsistencies

45 views
Skip to first unread message

ann.b....@gmail.com

unread,
Oct 15, 2015, 11:26:08 AM10/15/15
to Google Visualization API

I am having issues with inconsistencies in histograms.  I am trying to plot student test result data (test scores ranging from 0.2 to 1.0).  Sometimes, it puts the value 1.0 in a bin to the right (1.0-1.1).  Other times, it groups the value 1.0 in the bin to the left (0.9-1.0).  I have checked the outlier settings and am setting my own bin size (0.1), and I have changed nothing else to my knowledge.  Even within the same spreadsheet it will choose to graph these data different ways.  In the example above, "Pd 3 Measurement Quiz," one student scored 1.0 on the quiz, so that is shown in the 1.00-1.10 bin.  In "Pd 3 Measurement Quiz 2," two students scored between 0.9-1.0, and three students scored 1.0, yet they are all placed in the same bin.  The data came from the same spreadsheet.  I have not had this issue until yesterday, and I have made hundreds of histograms.

Any thoughts on this?  Thanks!

Sergey Grabkovsky

unread,
Oct 22, 2015, 11:50:25 AM10/22/15
to google-visua...@googlegroups.com
Hi Ann,

Nothing should have changed in our release during the time period that you mentioned, and more so, nothing has changed in the Histogram recently. Not to mention that the Histogram algorithm should be deterministic.

It would be extremely helpful if you would at least share the browser and operating system that you're seeing the issue on, since different browsers may behave differently (although this is not expected), but it would be more valuable if you could share your data as well, since that might be a contributing factor.

My attempts to reproduce this issue have thus far been unsuccessful. To test the issue, I created a jsfiddle that redraws a Histogram chart indefinitely and counts the number of instances that were rendered inconsistently (judging by the bounding boxes of the bars). I ran this fiddle on both Chrome and Firefox, and was unable to find any outliers (inconsistently rendered charts) after over 3000 renders. You can find my jsfiddle at http://jsfiddle.net/m461pdcc/ , and it should be fairly straightforward to substitute your own data.

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/55de9026-b4b8-4e88-bbef-6297f418aff8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

ann.b....@gmail.com

unread,
Oct 22, 2015, 12:30:40 PM10/22/15
to Google Visualization API
I am using Chrome with OS X Yosemite (10.10.4).  

It must be something about this particular data set.

Data from the first histogram (Pd 3 Measurement Quiz): 
1.00
0.58
0.58
0.42
0.67
0.83
0.25
0.58
0.67
0.75
0.67
0.25
0.50
0.50
0.83
0.42
0.50
0.67
0.92
0.67
0.58
0.33

Data from second histogram (Pd 3 Measurement Quiz 2):
1.00
0.63
0.88
0.50
0.71
0.75
0.33
0.71
0.88
0.88
0.83
1.00
0.33
0.54
0.92
0.67
0.67
0.88
0.71
0.50
0.88
1.00
0.63
0.96
0.54

Sergey Grabkovsky

unread,
Oct 22, 2015, 1:47:11 PM10/22/15
to Google Visualization API
I was still unable to reproduce the issue you described with your data. In my tests (also on Chrome on Yosemite), values are consistently placed into the same bucket across redraws.

However, I did find another issue, which is the one I think you were experiencing, where a value may be placed in the previous bucket (relative to the bucket it should have been placed in) because of floating point rounding errors in our code. I created this jsfiddle to demonstrate the issue: http://jsfiddle.net/hkg8wsmm/

As you can see, both the value 1.1 and the value 1.2 are placed in the [1.1, 1.2) bucket, when the value 1.2 should be placed in the [1.2, 1.3) bucket. Is this the issue you were describing?

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.

ann.b....@gmail.com

unread,
Oct 22, 2015, 7:46:12 PM10/22/15
to Google Visualization API
Yes!  That is exactly the issue.  Sometimes the value 1.0 is placed in the [1.0-1.1) bucket (as it should be), shown in my first graph from the first dataset.  The second dataset also includes the value 1.0, but it is incorrectly placed in the bucket [0.9-1.0), shown in the second graph.  

Is there anything I can do about this?


On Thursday, October 15, 2015 at 10:26:08 AM UTC-5, ann.b....@gmail.com wrote:

Daniel LaLiberte

unread,
Oct 23, 2015, 8:05:12 AM10/23/15
to Google Visualization API
We should be able to avoid this problem fairly easily, and the fix will show up in the next release, in about a month.

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.

For more options, visit https://groups.google.com/d/optout.



--
dlaliberte@Google.com   5CC, Cambridge MA
daniel.laliberte@GMail.com 9 Juniper Ridge Road, Acton MA
Reply all
Reply to author
Forward
0 new messages