Skip to content

Commit 4ffc52b

Browse files
committed
Set notch width range to (0, 0.5) instead of (0,1)
presumably for better consistency with Matlab
1 parent e621d0f commit 4ffc52b

File tree

4 files changed

+3
-3
lines changed

4 files changed

+3
-3
lines changed

src/traces/box/attributes.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,12 @@ module.exports = {
9696
notchwidth: {
9797
valType: 'number',
9898
min: 0,
99-
max: 1,
99+
max: 0.5,
100100
dflt: 0.25,
101101
role: 'style',
102102
editType: 'calcIfAutorange',
103103
description: [
104-
'Sets the width of the notches inversely proportional to',
104+
'Sets the width of the notches relative to',
105105
'the box\' width.',
106106
'For example, with 0, the notches are as wide as the box(es).'
107107
].join(' ')

src/traces/box/plot.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ function plotBoxAndWhiskers(sel, axes, trace, t) {
102102
var bPosPxOffset = t.bPosPxOffset || 0;
103103
var whiskerWidth = trace.whiskerwidth || 0;
104104
var notched = trace.notched || false;
105-
var nw = notched ? 1 - trace.notchwidth : 1;
105+
var nw = notched ? 1 - 2 * trace.notchwidth : 1;
106106

107107
// to support for one-sided box
108108
var bdPos0;
707 Bytes
Loading

test/image/baselines/box_notched.png

536 Bytes
Loading

0 commit comments

Comments
 (0)