Save panda boxplot as image The Next CEO of Stack OverflowSelecting multiple columns in a pandas dataframeRenaming columns in pandasAdding new column to existing DataFrame in Python pandasDelete column from pandas DataFrame by column name“Large data” work flows using pandasHow to iterate over rows in a DataFrame in Pandas?Select rows from a DataFrame based on values in a column in pandasGet list from pandas DataFrame column headersPandas and Python image to numpy arrayPandas DataFrame Slicing issue

What does convergence in distribution "in the Gromov–Hausdorff" sense mean?

Unreliable Magic - Is it worth it?

Bold, vivid family

Do I need to enable Dev Hub in my PROD Org?

How to start emacs in "nothing" mode (`fundamental-mode`)

Is "for causing autism in X" grammatical?

If a black hole is created from light, can this black hole then move at speed of light?

Why am I allowed to create multiple unique pointers from a single object?

Why do we use the plural of movies in this phrase "We went to the movies last night."?

Should I tutor a student who I know has cheated on their homework?

Which tube will fit a -(700 x 25c) wheel?

Multiple labels for a single equation

What exact does MIB represent in SNMP? How is it different from OID?

Skipping indices in a product

How do scammers retract money, while you can’t?

What connection does MS Office have to Netscape Navigator?

Is it professional to write unrelated content in an almost-empty email?

Does it take more energy to get to Venus or to Mars?

Won the lottery - how do I keep the money?

Phase of a real number

Interfacing a button to MCU (and PC) with 50m long cable

Why do professional authors make "consistency" mistakes? And how to avoid them?

How do I make a variable always equal to the result of some calculations?

How to Reset Passwords on Multiple Websites Easily?



Save panda boxplot as image



The Next CEO of Stack OverflowSelecting multiple columns in a pandas dataframeRenaming columns in pandasAdding new column to existing DataFrame in Python pandasDelete column from pandas DataFrame by column name“Large data” work flows using pandasHow to iterate over rows in a DataFrame in Pandas?Select rows from a DataFrame based on values in a column in pandasGet list from pandas DataFrame column headersPandas and Python image to numpy arrayPandas DataFrame Slicing issue










1















I'm trying to save a pandas.DataFrame.boxplot variable to a image to use it with a Qt widget, but I don't know how to convert this variable. I have this code:



import matplotlib.pyplot as plt
from pandas import DataFrame
import numpy as np


df = DataFrame(np.random.rand(10,5))
plt.figure();
bp = df.boxplot()


And Spyder shows it:



Are there instructions to do it automatically within the code?










share|improve this question




























    1















    I'm trying to save a pandas.DataFrame.boxplot variable to a image to use it with a Qt widget, but I don't know how to convert this variable. I have this code:



    import matplotlib.pyplot as plt
    from pandas import DataFrame
    import numpy as np


    df = DataFrame(np.random.rand(10,5))
    plt.figure();
    bp = df.boxplot()


    And Spyder shows it:



    Are there instructions to do it automatically within the code?










    share|improve this question


























      1












      1








      1








      I'm trying to save a pandas.DataFrame.boxplot variable to a image to use it with a Qt widget, but I don't know how to convert this variable. I have this code:



      import matplotlib.pyplot as plt
      from pandas import DataFrame
      import numpy as np


      df = DataFrame(np.random.rand(10,5))
      plt.figure();
      bp = df.boxplot()


      And Spyder shows it:



      Are there instructions to do it automatically within the code?










      share|improve this question
















      I'm trying to save a pandas.DataFrame.boxplot variable to a image to use it with a Qt widget, but I don't know how to convert this variable. I have this code:



      import matplotlib.pyplot as plt
      from pandas import DataFrame
      import numpy as np


      df = DataFrame(np.random.rand(10,5))
      plt.figure();
      bp = df.boxplot()


      And Spyder shows it:



      Are there instructions to do it automatically within the code?







      python pandas boxplot






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 7 at 15:26









      Leos313

      1,62411536




      1,62411536










      asked May 29 '17 at 14:12









      Daniel GarciaDaniel Garcia

      104




      104






















          2 Answers
          2






          active

          oldest

          votes


















          1














          Are you looking for a standard image format?



          If so this will do the trick:



          import matplotlib.pyplot as plt
          plt.savefig()


          docs:
          https://matplotlib.org/devdocs/api/_as_gen/matplotlib.pyplot.savefig.html






          share|improve this answer






























            0














            Suppose you have multiple figures and you want to save them independently when you want in the code: make sure you can access it by a unique name:



            fig100 = figure() 
            outputBoxplot100 = df_100.boxplot(column=['1', '2', '4', '5', '8'])
            plt.title("100 MHz")
            fig150 = figure()
            outputBoxplot150 = df_150.boxplot(column=['1', '2', '4', '5', '8'])
            plt.title("150 MHz")

            # do other stuff

            fig100.savefig("test100.svg", format="svg")
            fig150.savefig("test150.svg", format="svg")


            In this case, I would change your code in:



            import matplotlib.pyplot as plt
            from pandas import DataFrame
            import numpy as np


            df = DataFrame(np.random.rand(10,5))
            myFig = plt.figure();
            bp = df.boxplot()
            myFig.savefig("myName.svg", format="svg")


            The result will be a saved file named "myName.svg":



            enter image description here






            share|improve this answer

























              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%2f44244608%2fsave-panda-boxplot-as-image%23new-answer', 'question_page');

              );

              Post as a guest















              Required, but never shown

























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              1














              Are you looking for a standard image format?



              If so this will do the trick:



              import matplotlib.pyplot as plt
              plt.savefig()


              docs:
              https://matplotlib.org/devdocs/api/_as_gen/matplotlib.pyplot.savefig.html






              share|improve this answer



























                1














                Are you looking for a standard image format?



                If so this will do the trick:



                import matplotlib.pyplot as plt
                plt.savefig()


                docs:
                https://matplotlib.org/devdocs/api/_as_gen/matplotlib.pyplot.savefig.html






                share|improve this answer

























                  1












                  1








                  1







                  Are you looking for a standard image format?



                  If so this will do the trick:



                  import matplotlib.pyplot as plt
                  plt.savefig()


                  docs:
                  https://matplotlib.org/devdocs/api/_as_gen/matplotlib.pyplot.savefig.html






                  share|improve this answer













                  Are you looking for a standard image format?



                  If so this will do the trick:



                  import matplotlib.pyplot as plt
                  plt.savefig()


                  docs:
                  https://matplotlib.org/devdocs/api/_as_gen/matplotlib.pyplot.savefig.html







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered May 29 '17 at 14:18









                  Andrew LAndrew L

                  3,1732922




                  3,1732922























                      0














                      Suppose you have multiple figures and you want to save them independently when you want in the code: make sure you can access it by a unique name:



                      fig100 = figure() 
                      outputBoxplot100 = df_100.boxplot(column=['1', '2', '4', '5', '8'])
                      plt.title("100 MHz")
                      fig150 = figure()
                      outputBoxplot150 = df_150.boxplot(column=['1', '2', '4', '5', '8'])
                      plt.title("150 MHz")

                      # do other stuff

                      fig100.savefig("test100.svg", format="svg")
                      fig150.savefig("test150.svg", format="svg")


                      In this case, I would change your code in:



                      import matplotlib.pyplot as plt
                      from pandas import DataFrame
                      import numpy as np


                      df = DataFrame(np.random.rand(10,5))
                      myFig = plt.figure();
                      bp = df.boxplot()
                      myFig.savefig("myName.svg", format="svg")


                      The result will be a saved file named "myName.svg":



                      enter image description here






                      share|improve this answer





























                        0














                        Suppose you have multiple figures and you want to save them independently when you want in the code: make sure you can access it by a unique name:



                        fig100 = figure() 
                        outputBoxplot100 = df_100.boxplot(column=['1', '2', '4', '5', '8'])
                        plt.title("100 MHz")
                        fig150 = figure()
                        outputBoxplot150 = df_150.boxplot(column=['1', '2', '4', '5', '8'])
                        plt.title("150 MHz")

                        # do other stuff

                        fig100.savefig("test100.svg", format="svg")
                        fig150.savefig("test150.svg", format="svg")


                        In this case, I would change your code in:



                        import matplotlib.pyplot as plt
                        from pandas import DataFrame
                        import numpy as np


                        df = DataFrame(np.random.rand(10,5))
                        myFig = plt.figure();
                        bp = df.boxplot()
                        myFig.savefig("myName.svg", format="svg")


                        The result will be a saved file named "myName.svg":



                        enter image description here






                        share|improve this answer



























                          0












                          0








                          0







                          Suppose you have multiple figures and you want to save them independently when you want in the code: make sure you can access it by a unique name:



                          fig100 = figure() 
                          outputBoxplot100 = df_100.boxplot(column=['1', '2', '4', '5', '8'])
                          plt.title("100 MHz")
                          fig150 = figure()
                          outputBoxplot150 = df_150.boxplot(column=['1', '2', '4', '5', '8'])
                          plt.title("150 MHz")

                          # do other stuff

                          fig100.savefig("test100.svg", format="svg")
                          fig150.savefig("test150.svg", format="svg")


                          In this case, I would change your code in:



                          import matplotlib.pyplot as plt
                          from pandas import DataFrame
                          import numpy as np


                          df = DataFrame(np.random.rand(10,5))
                          myFig = plt.figure();
                          bp = df.boxplot()
                          myFig.savefig("myName.svg", format="svg")


                          The result will be a saved file named "myName.svg":



                          enter image description here






                          share|improve this answer















                          Suppose you have multiple figures and you want to save them independently when you want in the code: make sure you can access it by a unique name:



                          fig100 = figure() 
                          outputBoxplot100 = df_100.boxplot(column=['1', '2', '4', '5', '8'])
                          plt.title("100 MHz")
                          fig150 = figure()
                          outputBoxplot150 = df_150.boxplot(column=['1', '2', '4', '5', '8'])
                          plt.title("150 MHz")

                          # do other stuff

                          fig100.savefig("test100.svg", format="svg")
                          fig150.savefig("test150.svg", format="svg")


                          In this case, I would change your code in:



                          import matplotlib.pyplot as plt
                          from pandas import DataFrame
                          import numpy as np


                          df = DataFrame(np.random.rand(10,5))
                          myFig = plt.figure();
                          bp = df.boxplot()
                          myFig.savefig("myName.svg", format="svg")


                          The result will be a saved file named "myName.svg":



                          enter image description here







                          share|improve this answer














                          share|improve this answer



                          share|improve this answer








                          edited Mar 7 at 15:39

























                          answered Mar 7 at 13:56









                          Leos313Leos313

                          1,62411536




                          1,62411536



























                              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%2f44244608%2fsave-panda-boxplot-as-image%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







                              Popular posts from this blog

                              Save data to MySQL database using ExtJS and PHP [closed]2019 Community Moderator ElectionHow can I prevent SQL injection in PHP?Which MySQL data type to use for storing boolean valuesPHP: Delete an element from an arrayHow do I connect to a MySQL Database in Python?Should I use the datetime or timestamp data type in MySQL?How to get a list of MySQL user accountsHow Do You Parse and Process HTML/XML in PHP?Reference — What does this symbol mean in PHP?How does PHP 'foreach' actually work?Why shouldn't I use mysql_* functions in PHP?

                              Compiling GNU Global with universal-ctags support Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Tags for Emacs: Relationship between etags, ebrowse, cscope, GNU Global and exuberant ctagsVim and Ctags tips and trickscscope or ctags why choose one over the other?scons and ctagsctags cannot open option file “.ctags”Adding tag scopes in universal-ctagsShould I use Universal-ctags?Universal ctags on WindowsHow do I install GNU Global with universal ctags support using Homebrew?Universal ctags with emacsHow to highlight ctags generated by Universal Ctags in Vim?

                              Add ONERROR event to image from jsp tldHow to add an image to a JPanel?Saving image from PHP URLHTML img scalingCheck if an image is loaded (no errors) with jQueryHow to force an <img> to take up width, even if the image is not loadedHow do I populate hidden form field with a value set in Spring ControllerStyling Raw elements Generated from JSP tagds with Jquery MobileLimit resizing of images with explicitly set width and height attributeserror TLD use in a jsp fileJsp tld files cannot be resolved