Generate Box Plot From 5 Number Summary (Min,Max,Quantiles)?












0















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.










share|improve this question





























    0















    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.










    share|improve this question



























      0












      0








      0








      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.










      share|improve this question
















      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






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 20 '18 at 7:25









      petezurich

      3,65081834




      3,65081834










      asked Nov 20 '18 at 7:23









      MartanMartan

      484




      484
























          1 Answer
          1






          active

          oldest

          votes


















          1














          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:
          enter image description here






          share|improve this answer
























          • Edit: Yup work!

            – Martan
            Nov 20 '18 at 8:50













          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
          });


          }
          });














          draft saved

          draft discarded


















          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









          1














          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:
          enter image description here






          share|improve this answer
























          • Edit: Yup work!

            – Martan
            Nov 20 '18 at 8:50


















          1














          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:
          enter image description here






          share|improve this answer
























          • Edit: Yup work!

            – Martan
            Nov 20 '18 at 8:50
















          1












          1








          1







          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:
          enter image description here






          share|improve this answer













          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:
          enter image description here







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 20 '18 at 7:44









          H. RossH. Ross

          1819




          1819













          • 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







          Edit: Yup work!

          – Martan
          Nov 20 '18 at 8:50






















          draft saved

          draft discarded




















































          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.




          draft saved


          draft discarded














          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





















































          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







          這個網誌中的熱門文章

          Xamarin.form Move up view when keyboard appear

          Post-Redirect-Get with Spring WebFlux and Thymeleaf

          Java client can't connect to Redis Sentinel which is running on localhost