-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
use supplied bandwidth if provided #2552
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,13 +42,12 @@ module.exports = function calc(gd, trace) { | |
|
||
// sample standard deviation | ||
var ssd = Lib.stdev(vals, len - 1, cdi.mean); | ||
var bandwidthDflt = ruleOfThumbBandwidth(vals, ssd, cdi.q3 - cdi.q1); | ||
var bandwidth = cdi.bandwidth = trace.bandwidth || bandwidthDflt; | ||
var bandwidth = cdi.bandwidth = trace.bandwidth || ruleOfThumbBandwidth(vals, ssd, cdi.q3 - cdi.q1); | ||
var span = cdi.span = calcSpan(trace, cdi, valAxis, bandwidth); | ||
|
||
// step that well covers the bandwidth and is multiple of span distance | ||
var dist = span[1] - span[0]; | ||
var n = Math.ceil(dist / (Math.min(bandwidthDflt, bandwidth) / 3)); | ||
var n = Math.ceil(dist / (bandwidth / 3)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any reason for choosing just There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If I take the min, then n=103656617 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah ok. In this case, I'm thinking capping There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
You mean There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Good question. It comes from the very first violin commit. I must have taken that (possibly erroneously) from the seaborn implementation. |
||
var step = dist / n; | ||
|
||
if(!isFinite(step) || !isFinite(n)) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So for your data I suspect
bandwidthDflt
equals 0. Is this correct?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bandwidthDflt = 3.958842142868651e-8