Skip to content

Commit e621d0f

Browse files
committed
Change notchwidth convention to Matlab, d=0.25
1 parent 453d329 commit e621d0f

File tree

6 files changed

+12
-12
lines changed

6 files changed

+12
-12
lines changed

src/traces/box/attributes.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,13 @@ module.exports = {
9797
valType: 'number',
9898
min: 0,
9999
max: 1,
100-
dflt: 0.5,
100+
dflt: 0.25,
101101
role: 'style',
102102
editType: 'calcIfAutorange',
103103
description: [
104-
'Sets the width of the notches relative to',
104+
'Sets the width of the notches inversely proportional to',
105105
'the box\' width.',
106-
'For example, with 1, the whiskers are as wide as the box(es).'
106+
'For example, with 0, the notches are as wide as the box(es).'
107107
].join(' ')
108108
},
109109
boxpoints: {

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 ? trace.notchwidth : 1;
105+
var nw = notched ? 1 - trace.notchwidth : 1;
106106

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

test/image/baselines/box_notched.png

-508 Bytes
Loading

test/image/mocks/box_horz_notched.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,10 @@
144144
"color":"#1c9099"
145145
},
146146
"type":"box",
147-
"name":"Notch width = 0.8",
147+
"name":"Notch width = 0.1",
148148
"notched":true,
149149
"orientation": "h",
150-
"notchwidth":0.8
150+
"notchwidth":0.1
151151
},
152152
{
153153
"x":[
@@ -219,10 +219,10 @@
219219
"color":"#1c9099"
220220
},
221221
"type":"box",
222-
"name":"Notch width = 1",
222+
"name":"Notch width = 0",
223223
"notched":true,
224224
"orientation": "h",
225-
"notchwidth":1
225+
"notchwidth":0
226226
},
227227
{
228228
"x":[

test/image/mocks/box_notched.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@
143143
"color":"#1c9099"
144144
},
145145
"type":"box",
146-
"name":"Notch width = 0.8",
147-
"notchwidth":0.8
146+
"name":"Notch width = 0.1",
147+
"notchwidth":0.1
148148
},
149149
{
150150
"y":[
@@ -216,9 +216,9 @@
216216
"color":"#1c9099"
217217
},
218218
"type":"box",
219-
"name":"Notch width = 1",
219+
"name":"Notch width = 0",
220220
"notched":true,
221-
"notchwidth":1
221+
"notchwidth":0
222222
},
223223
{
224224
"y":[

0 commit comments

Comments
 (0)