DrPaulBrewer / single-market-robot-simulator-viz-plotly

middleware for generating charts with plotly from single-market-robot-simulator simulation logs
Other
1 stars 0 forks source link

review xrange and number of bins / bin size code for histograms #7

Closed DrPaulBrewer closed 4 years ago

DrPaulBrewer commented 4 years ago

In histogramFactory setting the nbinsx plotly property is advisory only.

Alternatively, xbins = {start, end, size} could be specified instead. Would this be better?

See: https://plotly.com/javascript/reference/#histogram

In practice, the number of bins and bin size can be an issue at the left and right end of the charts. Symmetric outcomes are distorted, for instance , when the first bin is [0,5) and the last bin is [500,504) with only data for 500.

DrPaulBrewer commented 4 years ago

The current solution is to effectively use a bin size of "1" for most variables that span a large range.

This looks much better, especially on QHD screens and with lots of data.

It may be less satisfactory on sparse data sets.