Generate Box Plot From 5 Number Summary (Min,Max,Quantiles)?
Some researchers often report results in form of 5 number summary. While for my methodology I have raw data, I would like to compare box plots.
Hence, is it possible to draw boxplot from 5 number summary using matplotlib/seaborn?
The idea has already been discussed for R [here] and here2.
python seaborn
add a comment |
Some researchers often report results in form of 5 number summary. While for my methodology I have raw data, I would like to compare box plots.
Hence, is it possible to draw boxplot from 5 number summary using matplotlib/seaborn?
The idea has already been discussed for R [here] and here2.
python seaborn
add a comment |
Some researchers often report results in form of 5 number summary. While for my methodology I have raw data, I would like to compare box plots.
Hence, is it possible to draw boxplot from 5 number summary using matplotlib/seaborn?
The idea has already been discussed for R [here] and here2.
python seaborn
Some researchers often report results in form of 5 number summary. While for my methodology I have raw data, I would like to compare box plots.
Hence, is it possible to draw boxplot from 5 number summary using matplotlib/seaborn?
The idea has already been discussed for R [here] and here2.
python seaborn
python seaborn
edited Nov 20 '18 at 7:25
petezurich
3,65081834
3,65081834
asked Nov 20 '18 at 7:23
MartanMartan
484
484
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
A 5 number summary could be seen as a dataset of 5 numbers: [min, Q1, Q2, Q3, max]
. Therefore, you can generate a dataset with these 5 numbers and plot them in a boxplot.
For example:
import seaborn
def fiveNumBox(mi, q1, q2, q3, ma):
data = [mi, q1, q2, q3, ma]
ax = seaborn.boxplot(data=data, orient="h")
ax.get_figure().savefig('figure.png')
fiveNumBox(1, 2, 3, 4, 5)
Generates:
Edit: Yup work!
– Martan
Nov 20 '18 at 8:50
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53388096%2fgenerate-box-plot-from-5-number-summary-min-max-quantiles%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
A 5 number summary could be seen as a dataset of 5 numbers: [min, Q1, Q2, Q3, max]
. Therefore, you can generate a dataset with these 5 numbers and plot them in a boxplot.
For example:
import seaborn
def fiveNumBox(mi, q1, q2, q3, ma):
data = [mi, q1, q2, q3, ma]
ax = seaborn.boxplot(data=data, orient="h")
ax.get_figure().savefig('figure.png')
fiveNumBox(1, 2, 3, 4, 5)
Generates:
Edit: Yup work!
– Martan
Nov 20 '18 at 8:50
add a comment |
A 5 number summary could be seen as a dataset of 5 numbers: [min, Q1, Q2, Q3, max]
. Therefore, you can generate a dataset with these 5 numbers and plot them in a boxplot.
For example:
import seaborn
def fiveNumBox(mi, q1, q2, q3, ma):
data = [mi, q1, q2, q3, ma]
ax = seaborn.boxplot(data=data, orient="h")
ax.get_figure().savefig('figure.png')
fiveNumBox(1, 2, 3, 4, 5)
Generates:
Edit: Yup work!
– Martan
Nov 20 '18 at 8:50
add a comment |
A 5 number summary could be seen as a dataset of 5 numbers: [min, Q1, Q2, Q3, max]
. Therefore, you can generate a dataset with these 5 numbers and plot them in a boxplot.
For example:
import seaborn
def fiveNumBox(mi, q1, q2, q3, ma):
data = [mi, q1, q2, q3, ma]
ax = seaborn.boxplot(data=data, orient="h")
ax.get_figure().savefig('figure.png')
fiveNumBox(1, 2, 3, 4, 5)
Generates:
A 5 number summary could be seen as a dataset of 5 numbers: [min, Q1, Q2, Q3, max]
. Therefore, you can generate a dataset with these 5 numbers and plot them in a boxplot.
For example:
import seaborn
def fiveNumBox(mi, q1, q2, q3, ma):
data = [mi, q1, q2, q3, ma]
ax = seaborn.boxplot(data=data, orient="h")
ax.get_figure().savefig('figure.png')
fiveNumBox(1, 2, 3, 4, 5)
Generates:
answered Nov 20 '18 at 7:44
H. RossH. Ross
1819
1819
Edit: Yup work!
– Martan
Nov 20 '18 at 8:50
add a comment |
Edit: Yup work!
– Martan
Nov 20 '18 at 8:50
Edit: Yup work!
– Martan
Nov 20 '18 at 8:50
Edit: Yup work!
– Martan
Nov 20 '18 at 8:50
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53388096%2fgenerate-box-plot-from-5-number-summary-min-max-quantiles%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown