From e247af1d92e741c173346cc1254e0e75d4ffe915 Mon Sep 17 00:00:00 2001 From: Joseph Damiba Date: Thu, 9 Jan 2020 16:40:14 -0500 Subject: [PATCH 1/2] documenting 1.52 boxplot features --- .../2019-09-02-fill-area_plotly_js_index.html | 2 +- ...2020-01-09-precomputed-quartiles copy.html | 49 +++++++++++++++++++ .../box/2020-01-09-quartile-methods.html | 35 +++++++++++++ 3 files changed, 85 insertions(+), 1 deletion(-) create mode 100644 _posts/plotly_js/statistical/box/2020-01-09-precomputed-quartiles copy.html create mode 100644 _posts/plotly_js/statistical/box/2020-01-09-quartile-methods.html diff --git a/_posts/plotly_js/maps/fill-area-on-mapbox/2019-09-02-fill-area_plotly_js_index.html b/_posts/plotly_js/maps/fill-area-on-mapbox/2019-09-02-fill-area_plotly_js_index.html index 16f2c3ed7a07..0aa9c6d018a3 100644 --- a/_posts/plotly_js/maps/fill-area-on-mapbox/2019-09-02-fill-area_plotly_js_index.html +++ b/_posts/plotly_js/maps/fill-area-on-mapbox/2019-09-02-fill-area_plotly_js_index.html @@ -2,7 +2,7 @@ name: Filled Area on Maps permalink: javascript/filled-area-on-mapbox/ description: How to make an area on Map using a D3.js-based scattermapbox. -layout: user-guide +layout: base thumbnail: thumbnail/area.jpg language: plotly_js has_thumbnail: true diff --git a/_posts/plotly_js/statistical/box/2020-01-09-precomputed-quartiles copy.html b/_posts/plotly_js/statistical/box/2020-01-09-precomputed-quartiles copy.html new file mode 100644 index 000000000000..e9fce4567d41 --- /dev/null +++ b/_posts/plotly_js/statistical/box/2020-01-09-precomputed-quartiles copy.html @@ -0,0 +1,49 @@ +--- +name: Precomputed Quartiles +arrangement: horizontal +language: plotly_js +suite: box +order: 13 +sitemap: false +--- + +Plotly.newPlot('myDiv', [ + { + "type": "box", + "name": "just q1/median/q3", + "offsetgroup": "1", + "q1": [ 1, 2, 1 ], + "median": [ 2, 3, 2 ], + "q3": [ 3, 4, 3 ] + }, + { + "type": "box", + "name": "q1/median/q3/lowerfence/upperfence", + "offsetgroup": "2", + "q1": [ 1, 2, 1 ], + "median": [ 2, 3, 2 ], + "q3": [ 3, 4, 3 ], + "lowerfence": [ 0, 1, 0 ], + "upperfence": [ 4, 5, 4 ] + }, + { + "type": "box", + "name": "all pre-computed stats", + "offsetgroup": "3", + "q1": [ 1, 2, 1 ], + "median": [ 2, 3, 2 ], + "q3": [ 3, 4, 3 ], + "lowerfence": [ 0, 1, 0 ], + "upperfence": [ 4, 5, 4 ], + "mean": [ 2.2, 2.8, 2.2 ], + "sd": [ 0.4, 0.4, 0.4 ], + "notchspan": [ 0.2, 0.1, 0.2 ] + }], + { + boxmode: 'group', + legend: { + x: 0, + y: 1, yanchor: 'bottom' + } + } +) \ No newline at end of file diff --git a/_posts/plotly_js/statistical/box/2020-01-09-quartile-methods.html b/_posts/plotly_js/statistical/box/2020-01-09-quartile-methods.html new file mode 100644 index 000000000000..96f815717f7d --- /dev/null +++ b/_posts/plotly_js/statistical/box/2020-01-09-quartile-methods.html @@ -0,0 +1,35 @@ +--- +name: Inclusive, Exclusive, and Linear Quartiles +arrangement: horizontal +language: plotly_js +suite: box +order: 14 +sitemap: false +markdown_content: | + - The *linear* method uses the 25th percentile for Q1 and 75th percentile for Q3, as computed using method #10 listed on http://www.amstat.org/publications/jse/v14n3/langford.html)., + - The *exclusive* method uses the median to divide the ordered dataset into two halves. If the sample is odd, it does not includes the median in either half. + - The *inclusive* method also uses the median to divide the ordered dataset into two halves. If the sample is odd, it includes the median in both halves. +--- +Plotly.newPlot('myDiv', { + "data": [{ + "type": "box", + "y": [1, 2, 3, 4, 5], + "name": "linear" + }, + { + "type": "box", + "y": [1, 2, 3, 4, 5], + "name": "exclusive", + "quartilemethod": "exclusive" + }, + { + "type": "box", + "y": [1, 2, 3, 4, 5], + "name": "inclusive", + "quartilemethod": "inclusive" + }], + "layout": { + "width": 400, + "height": 400 + } + }) \ No newline at end of file From f474ed3f07230f0b04237773f8c26cace2e8165b Mon Sep 17 00:00:00 2001 From: Joseph Damiba Date: Mon, 13 Jan 2020 08:29:53 -0500 Subject: [PATCH 2/2] fixing up content --- .../box/2020-01-09-precomputed-quartiles copy.html | 6 ++++-- .../statistical/box/2020-01-09-quartile-methods.html | 12 +++++++----- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/_posts/plotly_js/statistical/box/2020-01-09-precomputed-quartiles copy.html b/_posts/plotly_js/statistical/box/2020-01-09-precomputed-quartiles copy.html index e9fce4567d41..4590b2c6e387 100644 --- a/_posts/plotly_js/statistical/box/2020-01-09-precomputed-quartiles copy.html +++ b/_posts/plotly_js/statistical/box/2020-01-09-precomputed-quartiles copy.html @@ -1,10 +1,12 @@ --- -name: Precomputed Quartiles +name: Using Precomputed Values For Quartiles arrangement: horizontal language: plotly_js suite: box -order: 13 +order: 14 sitemap: false +markdown_content: | + Instead of using one of the built-in algorithms to compute quartiles, you might want to precompute the values of the quartiles. This could be because you have a large data set and computing quartiles at runtime would slow down your application, or if you want to use a different algorithm than the ones that are provided. In this case, omit the `quartilemethod` attribute and pass in the values you want to use directly. --- Plotly.newPlot('myDiv', [ diff --git a/_posts/plotly_js/statistical/box/2020-01-09-quartile-methods.html b/_posts/plotly_js/statistical/box/2020-01-09-quartile-methods.html index 96f815717f7d..fddb7a70bbc4 100644 --- a/_posts/plotly_js/statistical/box/2020-01-09-quartile-methods.html +++ b/_posts/plotly_js/statistical/box/2020-01-09-quartile-methods.html @@ -1,14 +1,16 @@ --- -name: Inclusive, Exclusive, and Linear Quartiles +name: Choosing the Algorithm Used To Compute Quartiles arrangement: horizontal language: plotly_js suite: box -order: 14 +order: 13 sitemap: false markdown_content: | - - The *linear* method uses the 25th percentile for Q1 and 75th percentile for Q3, as computed using method #10 listed on http://www.amstat.org/publications/jse/v14n3/langford.html)., - - The *exclusive* method uses the median to divide the ordered dataset into two halves. If the sample is odd, it does not includes the median in either half. - - The *inclusive* method also uses the median to divide the ordered dataset into two halves. If the sample is odd, it includes the median in both halves. + The `quartilemethod` attribute controls the algorithm that is used to compute quartiles for box plots. + + - The *linear* algorithm uses the 25th percentile for Q1 and 75th percentile for Q3, as computed using method #10 listed at [http://www.amstat.org/publications/jse/v14n3/langford.html](http://www.amstat.org/publications/jse/v14n3/langford.html). + - The *exclusive* algorithm uses the median to divide the ordered dataset into two halves. If the sample is odd, it does not includes the median in either half. + - The *inclusive* algorithm also uses the median to divide the ordered dataset into two halves. However, if the sample is odd, it includes the median in both halves. --- Plotly.newPlot('myDiv', { "data": [{