-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Implement notched box plots, closes #2286 #2305
Changes from 6 commits
a234668
144989c
0eb99e0
453d329
e621d0f
4ffc52b
8dde2d2
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 |
---|---|---|
@@ -0,0 +1,290 @@ | ||
{ | ||
"data":[ | ||
{ | ||
"x":[ | ||
90, | ||
88, | ||
55, | ||
88, | ||
72, | ||
100, | ||
88, | ||
25, | ||
92, | ||
100, | ||
82, | ||
82, | ||
90, | ||
68, | ||
85, | ||
82, | ||
40, | ||
100, | ||
92, | ||
82, | ||
55, | ||
62, | ||
85, | ||
100, | ||
75, | ||
88, | ||
78, | ||
80, | ||
92, | ||
100, | ||
88, | ||
72, | ||
95, | ||
80, | ||
90, | ||
72, | ||
100, | ||
100, | ||
75, | ||
82, | ||
60, | ||
90, | ||
85, | ||
90, | ||
38, | ||
78, | ||
82, | ||
100, | ||
90, | ||
80, | ||
80, | ||
100, | ||
70, | ||
100, | ||
82, | ||
62, | ||
92, | ||
100, | ||
80, | ||
100, | ||
88, | ||
85 | ||
], | ||
"line":{ | ||
"color":"#1c9099" | ||
}, | ||
"type":"box", | ||
"name":"Notched = True", | ||
"orientation": "h", | ||
"notched":true | ||
}, | ||
{ | ||
"x":[ | ||
70, | ||
65, | ||
85, | ||
75, | ||
72, | ||
75, | ||
90, | ||
88, | ||
85, | ||
80, | ||
92, | ||
85, | ||
85, | ||
75, | ||
72, | ||
80, | ||
42, | ||
80, | ||
95, | ||
90, | ||
62, | ||
65, | ||
65, | ||
82, | ||
68, | ||
48, | ||
57, | ||
95, | ||
70, | ||
100, | ||
80, | ||
95, | ||
78, | ||
80, | ||
80, | ||
85, | ||
90, | ||
100, | ||
52, | ||
85, | ||
72, | ||
70, | ||
45, | ||
75, | ||
85, | ||
95, | ||
65, | ||
70, | ||
85, | ||
70, | ||
85, | ||
35, | ||
90, | ||
95, | ||
95, | ||
65, | ||
62, | ||
48, | ||
60, | ||
85, | ||
85, | ||
90, | ||
70, | ||
68 | ||
], | ||
"line":{ | ||
"color":"#1c9099" | ||
}, | ||
"type":"box", | ||
"name":"Notch width = 0.1", | ||
"notched":true, | ||
"orientation": "h", | ||
"notchwidth":0.1 | ||
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. Actually looks like the mocks and baseline images got out of sync. This one uses 0.2 in both images. 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 are right. I updated the baselines, hope that all will work this time. |
||
}, | ||
{ | ||
"x":[ | ||
95, | ||
75, | ||
70, | ||
72, | ||
52, | ||
70, | ||
82, | ||
90, | ||
95, | ||
80, | ||
68, | ||
88, | ||
82, | ||
52, | ||
80, | ||
78, | ||
57, | ||
88, | ||
88, | ||
100, | ||
50, | ||
65, | ||
78, | ||
92, | ||
65, | ||
50, | ||
60, | ||
88, | ||
100, | ||
50, | ||
90, | ||
70, | ||
60, | ||
72, | ||
75, | ||
95, | ||
100, | ||
45, | ||
68, | ||
72, | ||
45, | ||
60, | ||
78, | ||
85, | ||
92, | ||
45, | ||
68, | ||
70, | ||
85, | ||
82, | ||
62, | ||
75, | ||
100, | ||
80, | ||
65, | ||
52, | ||
48, | ||
57, | ||
100, | ||
72, | ||
100, | ||
80, | ||
65 | ||
], | ||
"line":{ | ||
"color":"#1c9099" | ||
}, | ||
"type":"box", | ||
"name":"Notch width = 0", | ||
"notched":true, | ||
"orientation": "h", | ||
"notchwidth":0 | ||
}, | ||
{ | ||
"x":[ | ||
86, | ||
64, | ||
86.2, | ||
91.1, | ||
86, | ||
85.3, | ||
85.30000000000001, | ||
63.7, | ||
47.400000000000006, | ||
89.2, | ||
91.3, | ||
91.6, | ||
55.099999999999994, | ||
64.1, | ||
76.2, | ||
91.4, | ||
68.9, | ||
60.8, | ||
64.5, | ||
87.7, | ||
21, | ||
97.6, | ||
90.9, | ||
86.6, | ||
100, | ||
33.6, | ||
82.7, | ||
63.599999999999994, | ||
55.5, | ||
80.7, | ||
85, | ||
92.30000000000001, | ||
48.9, | ||
85 | ||
], | ||
"line":{ | ||
"color":"#1c9099" | ||
}, | ||
"type":"box", | ||
"name":"Outside of hinges", | ||
"orientation": "h", | ||
"notched":true | ||
} | ||
], | ||
"layout":{ | ||
"showlegend":false, | ||
"xaxis":{ | ||
"title":"Grade [%]", | ||
"type":"linear" | ||
}, | ||
"title":"Based on Fig 4.4a: Course Grade Distributions", | ||
"yaxis":{ | ||
"type":"category" | ||
}, | ||
"height":598, | ||
"width":1080, | ||
"margin":{ | ||
"l":110 | ||
}, | ||
"autosize":true | ||
} | ||
} |
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.
I wonder if we can get away with just a
notchwidth
similar to how whiskers are set (withwhiskerwidth
)?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.
Are you suggesting to remove
if(notched)
?Btw. this line was modified after this comment: krassowski#1 (comment)
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.
Yes, that's what I'm suggesting. Waiting on a concensus.
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.
I think @etpinard was suggesting removing the
notched
attribute altogether and just defaulting tonotchwidth=0
as no notch. I thought about this but would prefer the existing way so that we can pick a nice defaultnotchwidth
rather than everyone making up random values. One thing we could do though is make the default for notched betrue
iftraceIn.notchwidth !== undefined
. That way if you do want a custom width you don’t also need to providenotched
.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.
yes, this is what I meant. Sorry for the confusion.
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.
Good point here. I wonder if we should do the same for whiskers in v2? That is, adding a
showwhiskers
boolean and making thewhiskerswidth
default smarter?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.
My argument doesn't really apply to whiskers - though I'm not sure I get what you mean by smarter default. If we're happy with the default
whiskerwidth
staying at0.5
then people can use0
(a very non-random number 😄 ) to disable whiskers and any other number for a custom width.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.
@krassowski in talking with @etpinard offline, we agreed that despite the correspondence with
whiskerwidth
the Matlab convention makes more sense, to us anyway - so that's 0=no notch, 0.5=meet in the middle, with a default of 0.25.And re: my comment:
That's just removing
attributes.notched.dflt
and changing its coerce line to:var notched = coerce('notched', traceIn.notchwidth !== undefined);
You'll also want to merge in the latest master so tests pass, then I think we're ready to go!