Skip to content

Commit

Permalink
Set notch width range to (0, 0.5) instead of (0,1)
Browse files Browse the repository at this point in the history
presumably for better consistency with Matlab
  • Loading branch information
krassowski committed Jan 30, 2018
1 parent e621d0f commit 4ffc52b
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/traces/box/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,12 @@ module.exports = {
notchwidth: {
valType: 'number',
min: 0,
max: 1,
max: 0.5,
dflt: 0.25,
role: 'style',
editType: 'calcIfAutorange',
description: [
'Sets the width of the notches inversely proportional to',
'Sets the width of the notches relative to',
'the box\' width.',
'For example, with 0, the notches are as wide as the box(es).'
].join(' ')
Expand Down
2 changes: 1 addition & 1 deletion src/traces/box/plot.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ function plotBoxAndWhiskers(sel, axes, trace, t) {
var bPosPxOffset = t.bPosPxOffset || 0;
var whiskerWidth = trace.whiskerwidth || 0;
var notched = trace.notched || false;
var nw = notched ? 1 - trace.notchwidth : 1;
var nw = notched ? 1 - 2 * trace.notchwidth : 1;

// to support for one-sided box
var bdPos0;
Expand Down
Binary file modified test/image/baselines/box_horz_notched.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/box_notched.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 4ffc52b

Please sign in to comment.