Matplotlib notebook magic inline/plotting commands not working











up vote
0
down vote

favorite












I am running a jupyter notebook (5.7.0) with pandas (0.23.4) and matplotlib (3.0.1). When I try to plot using the



pandas.DataFrame.plot()


function it gives me the text of the object:



<pandas.plotting._core.FramePlotMethods object at 0x7f612fdb74a8>


Naturally I googled this, and have sinced tried the magic commands:



%matplotlib inline


and



%matplotlib notebook


in the very first cell after shutting down the notebook and restarting it, and still it seems to make no difference.



So for completeness sake, my first cell is the magic command, and in the second I import numpy,pandas and matplotlib. In the following cells are create my array and pass it to the DataFrame command. Finally I call:



pandas.DataFrame.plot(df) 


and the text of the object (from above) appears, regardless of whether I run the magic commands or not. Have I got the incorrect version of something? Do I need to restart the entire notebook server?










share|improve this question


























    up vote
    0
    down vote

    favorite












    I am running a jupyter notebook (5.7.0) with pandas (0.23.4) and matplotlib (3.0.1). When I try to plot using the



    pandas.DataFrame.plot()


    function it gives me the text of the object:



    <pandas.plotting._core.FramePlotMethods object at 0x7f612fdb74a8>


    Naturally I googled this, and have sinced tried the magic commands:



    %matplotlib inline


    and



    %matplotlib notebook


    in the very first cell after shutting down the notebook and restarting it, and still it seems to make no difference.



    So for completeness sake, my first cell is the magic command, and in the second I import numpy,pandas and matplotlib. In the following cells are create my array and pass it to the DataFrame command. Finally I call:



    pandas.DataFrame.plot(df) 


    and the text of the object (from above) appears, regardless of whether I run the magic commands or not. Have I got the incorrect version of something? Do I need to restart the entire notebook server?










    share|improve this question
























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I am running a jupyter notebook (5.7.0) with pandas (0.23.4) and matplotlib (3.0.1). When I try to plot using the



      pandas.DataFrame.plot()


      function it gives me the text of the object:



      <pandas.plotting._core.FramePlotMethods object at 0x7f612fdb74a8>


      Naturally I googled this, and have sinced tried the magic commands:



      %matplotlib inline


      and



      %matplotlib notebook


      in the very first cell after shutting down the notebook and restarting it, and still it seems to make no difference.



      So for completeness sake, my first cell is the magic command, and in the second I import numpy,pandas and matplotlib. In the following cells are create my array and pass it to the DataFrame command. Finally I call:



      pandas.DataFrame.plot(df) 


      and the text of the object (from above) appears, regardless of whether I run the magic commands or not. Have I got the incorrect version of something? Do I need to restart the entire notebook server?










      share|improve this question













      I am running a jupyter notebook (5.7.0) with pandas (0.23.4) and matplotlib (3.0.1). When I try to plot using the



      pandas.DataFrame.plot()


      function it gives me the text of the object:



      <pandas.plotting._core.FramePlotMethods object at 0x7f612fdb74a8>


      Naturally I googled this, and have sinced tried the magic commands:



      %matplotlib inline


      and



      %matplotlib notebook


      in the very first cell after shutting down the notebook and restarting it, and still it seems to make no difference.



      So for completeness sake, my first cell is the magic command, and in the second I import numpy,pandas and matplotlib. In the following cells are create my array and pass it to the DataFrame command. Finally I call:



      pandas.DataFrame.plot(df) 


      and the text of the object (from above) appears, regardless of whether I run the magic commands or not. Have I got the incorrect version of something? Do I need to restart the entire notebook server?







      python pandas matplotlib jupyter-notebook






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked yesterday









      bidby

      87112




      87112
























          1 Answer
          1






          active

          oldest

          votes

















          up vote
          1
          down vote



          accepted










          You misunderstood the way plotting works. What you are trying here is



          import pandas
          df=pandas.DataFrame([1,2,3])
          pandas.DataFrame.plot(df)


          What you need to do instead is



          import pandas
          df=pandas.DataFrame([1,2,3])
          df.plot()





          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',
            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%2f53372674%2fmatplotlib-notebook-magic-inline-plotting-commands-not-working%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








            up vote
            1
            down vote



            accepted










            You misunderstood the way plotting works. What you are trying here is



            import pandas
            df=pandas.DataFrame([1,2,3])
            pandas.DataFrame.plot(df)


            What you need to do instead is



            import pandas
            df=pandas.DataFrame([1,2,3])
            df.plot()





            share|improve this answer

























              up vote
              1
              down vote



              accepted










              You misunderstood the way plotting works. What you are trying here is



              import pandas
              df=pandas.DataFrame([1,2,3])
              pandas.DataFrame.plot(df)


              What you need to do instead is



              import pandas
              df=pandas.DataFrame([1,2,3])
              df.plot()





              share|improve this answer























                up vote
                1
                down vote



                accepted







                up vote
                1
                down vote



                accepted






                You misunderstood the way plotting works. What you are trying here is



                import pandas
                df=pandas.DataFrame([1,2,3])
                pandas.DataFrame.plot(df)


                What you need to do instead is



                import pandas
                df=pandas.DataFrame([1,2,3])
                df.plot()





                share|improve this answer












                You misunderstood the way plotting works. What you are trying here is



                import pandas
                df=pandas.DataFrame([1,2,3])
                pandas.DataFrame.plot(df)


                What you need to do instead is



                import pandas
                df=pandas.DataFrame([1,2,3])
                df.plot()






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered yesterday









                ImportanceOfBeingErnest

                118k10116189




                118k10116189






























                     

                    draft saved


                    draft discarded



















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53372674%2fmatplotlib-notebook-magic-inline-plotting-commands-not-working%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

                    Can a sorcerer learn a 5th-level spell early by creating spell slots using the Font of Magic feature?

                    ts Property 'filter' does not exist on type '{}'

                    Notepad++ export/extract a list of installed plugins