AttributeError: 'module' object has no attribute 'to_rgba'










0














I got error when I used matplotlib.pyplot to show image



 5 plt.ylim(-5,6)
6 plt.title('Question 1(c): sample cluster data (10,000 points per cluster)')
----> 7 plt.show()

C:UsersyashiAnaconda3envsCSC411libsite-packagesmatplotlibpyplot.py in show(*args, **kw)
242 In non-interactive mode, display all figures and block until
243 the figures have been closed; in interactive mode it has no
--> 244 effect unless figures were created prior to a change from
245 non-interactive to interactive mode (not recommended). In
246 that case it displays the figures but does not block.

C:UsersyashiAnaconda3envsCSC411libsite-packagesipykernelpylabbackend_inline.pyc in show(close, block)
37 display(
38 figure_manager.canvas.figure,
---> 39 metadata=_fetch_figure_metadata(figure_manager.canvas.figure)
40 )
41 finally:

C:UsersyashiAnaconda3envsCSC411libsite-packagesipykernelpylabbackend_inline.pyc in _fetch_figure_metadata(fig)
172 """Get some metadata to help with displaying a figure."""
173 # determine if a background is needed for legibility
--> 174 if _is_transparent(fig.get_facecolor()):
175 # the background is transparent
176 ticksLight = _is_light([label.get_color()

C:UsersyashiAnaconda3envsCSC411libsite-packagesipykernelpylabbackend_inline.pyc in _is_transparent(color)
193 def _is_transparent(color):
194 """Determine transparency from alpha."""
--> 195 rgba = colors.to_rgba(color)
196 return rgba[3] < .5

AttributeError: 'module' object has no attribute 'to_rgba'


According to the post,



I updated matplotlib to 2.23 but it still doesn't work. How can I fix it?










share|improve this question





















  • Feel free to provide a Minimal, Complete, and Verifiable example of the issue. Add print(matplotlib.__version__) to it to see if 2.2.3 is really used.
    – ImportanceOfBeingErnest
    Nov 13 '18 at 13:25










  • @ImportanceOfBeingErnest Yes, it is 2.23
    – user8314628
    Nov 13 '18 at 13:29










  • If you want someone to find out what's wrong you should be a little more cooperative. The information you provide simply does not suffice to find out anything about the problem. You need a Minimal, Complete, and Verifiable example that other people can run and you need to state how you run it.
    – ImportanceOfBeingErnest
    Nov 13 '18 at 13:35















0














I got error when I used matplotlib.pyplot to show image



 5 plt.ylim(-5,6)
6 plt.title('Question 1(c): sample cluster data (10,000 points per cluster)')
----> 7 plt.show()

C:UsersyashiAnaconda3envsCSC411libsite-packagesmatplotlibpyplot.py in show(*args, **kw)
242 In non-interactive mode, display all figures and block until
243 the figures have been closed; in interactive mode it has no
--> 244 effect unless figures were created prior to a change from
245 non-interactive to interactive mode (not recommended). In
246 that case it displays the figures but does not block.

C:UsersyashiAnaconda3envsCSC411libsite-packagesipykernelpylabbackend_inline.pyc in show(close, block)
37 display(
38 figure_manager.canvas.figure,
---> 39 metadata=_fetch_figure_metadata(figure_manager.canvas.figure)
40 )
41 finally:

C:UsersyashiAnaconda3envsCSC411libsite-packagesipykernelpylabbackend_inline.pyc in _fetch_figure_metadata(fig)
172 """Get some metadata to help with displaying a figure."""
173 # determine if a background is needed for legibility
--> 174 if _is_transparent(fig.get_facecolor()):
175 # the background is transparent
176 ticksLight = _is_light([label.get_color()

C:UsersyashiAnaconda3envsCSC411libsite-packagesipykernelpylabbackend_inline.pyc in _is_transparent(color)
193 def _is_transparent(color):
194 """Determine transparency from alpha."""
--> 195 rgba = colors.to_rgba(color)
196 return rgba[3] < .5

AttributeError: 'module' object has no attribute 'to_rgba'


According to the post,



I updated matplotlib to 2.23 but it still doesn't work. How can I fix it?










share|improve this question





















  • Feel free to provide a Minimal, Complete, and Verifiable example of the issue. Add print(matplotlib.__version__) to it to see if 2.2.3 is really used.
    – ImportanceOfBeingErnest
    Nov 13 '18 at 13:25










  • @ImportanceOfBeingErnest Yes, it is 2.23
    – user8314628
    Nov 13 '18 at 13:29










  • If you want someone to find out what's wrong you should be a little more cooperative. The information you provide simply does not suffice to find out anything about the problem. You need a Minimal, Complete, and Verifiable example that other people can run and you need to state how you run it.
    – ImportanceOfBeingErnest
    Nov 13 '18 at 13:35













0












0








0







I got error when I used matplotlib.pyplot to show image



 5 plt.ylim(-5,6)
6 plt.title('Question 1(c): sample cluster data (10,000 points per cluster)')
----> 7 plt.show()

C:UsersyashiAnaconda3envsCSC411libsite-packagesmatplotlibpyplot.py in show(*args, **kw)
242 In non-interactive mode, display all figures and block until
243 the figures have been closed; in interactive mode it has no
--> 244 effect unless figures were created prior to a change from
245 non-interactive to interactive mode (not recommended). In
246 that case it displays the figures but does not block.

C:UsersyashiAnaconda3envsCSC411libsite-packagesipykernelpylabbackend_inline.pyc in show(close, block)
37 display(
38 figure_manager.canvas.figure,
---> 39 metadata=_fetch_figure_metadata(figure_manager.canvas.figure)
40 )
41 finally:

C:UsersyashiAnaconda3envsCSC411libsite-packagesipykernelpylabbackend_inline.pyc in _fetch_figure_metadata(fig)
172 """Get some metadata to help with displaying a figure."""
173 # determine if a background is needed for legibility
--> 174 if _is_transparent(fig.get_facecolor()):
175 # the background is transparent
176 ticksLight = _is_light([label.get_color()

C:UsersyashiAnaconda3envsCSC411libsite-packagesipykernelpylabbackend_inline.pyc in _is_transparent(color)
193 def _is_transparent(color):
194 """Determine transparency from alpha."""
--> 195 rgba = colors.to_rgba(color)
196 return rgba[3] < .5

AttributeError: 'module' object has no attribute 'to_rgba'


According to the post,



I updated matplotlib to 2.23 but it still doesn't work. How can I fix it?










share|improve this question













I got error when I used matplotlib.pyplot to show image



 5 plt.ylim(-5,6)
6 plt.title('Question 1(c): sample cluster data (10,000 points per cluster)')
----> 7 plt.show()

C:UsersyashiAnaconda3envsCSC411libsite-packagesmatplotlibpyplot.py in show(*args, **kw)
242 In non-interactive mode, display all figures and block until
243 the figures have been closed; in interactive mode it has no
--> 244 effect unless figures were created prior to a change from
245 non-interactive to interactive mode (not recommended). In
246 that case it displays the figures but does not block.

C:UsersyashiAnaconda3envsCSC411libsite-packagesipykernelpylabbackend_inline.pyc in show(close, block)
37 display(
38 figure_manager.canvas.figure,
---> 39 metadata=_fetch_figure_metadata(figure_manager.canvas.figure)
40 )
41 finally:

C:UsersyashiAnaconda3envsCSC411libsite-packagesipykernelpylabbackend_inline.pyc in _fetch_figure_metadata(fig)
172 """Get some metadata to help with displaying a figure."""
173 # determine if a background is needed for legibility
--> 174 if _is_transparent(fig.get_facecolor()):
175 # the background is transparent
176 ticksLight = _is_light([label.get_color()

C:UsersyashiAnaconda3envsCSC411libsite-packagesipykernelpylabbackend_inline.pyc in _is_transparent(color)
193 def _is_transparent(color):
194 """Determine transparency from alpha."""
--> 195 rgba = colors.to_rgba(color)
196 return rgba[3] < .5

AttributeError: 'module' object has no attribute 'to_rgba'


According to the post,



I updated matplotlib to 2.23 but it still doesn't work. How can I fix it?







matplotlib






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 13 '18 at 1:19









user8314628user8314628

54629




54629











  • Feel free to provide a Minimal, Complete, and Verifiable example of the issue. Add print(matplotlib.__version__) to it to see if 2.2.3 is really used.
    – ImportanceOfBeingErnest
    Nov 13 '18 at 13:25










  • @ImportanceOfBeingErnest Yes, it is 2.23
    – user8314628
    Nov 13 '18 at 13:29










  • If you want someone to find out what's wrong you should be a little more cooperative. The information you provide simply does not suffice to find out anything about the problem. You need a Minimal, Complete, and Verifiable example that other people can run and you need to state how you run it.
    – ImportanceOfBeingErnest
    Nov 13 '18 at 13:35
















  • Feel free to provide a Minimal, Complete, and Verifiable example of the issue. Add print(matplotlib.__version__) to it to see if 2.2.3 is really used.
    – ImportanceOfBeingErnest
    Nov 13 '18 at 13:25










  • @ImportanceOfBeingErnest Yes, it is 2.23
    – user8314628
    Nov 13 '18 at 13:29










  • If you want someone to find out what's wrong you should be a little more cooperative. The information you provide simply does not suffice to find out anything about the problem. You need a Minimal, Complete, and Verifiable example that other people can run and you need to state how you run it.
    – ImportanceOfBeingErnest
    Nov 13 '18 at 13:35















Feel free to provide a Minimal, Complete, and Verifiable example of the issue. Add print(matplotlib.__version__) to it to see if 2.2.3 is really used.
– ImportanceOfBeingErnest
Nov 13 '18 at 13:25




Feel free to provide a Minimal, Complete, and Verifiable example of the issue. Add print(matplotlib.__version__) to it to see if 2.2.3 is really used.
– ImportanceOfBeingErnest
Nov 13 '18 at 13:25












@ImportanceOfBeingErnest Yes, it is 2.23
– user8314628
Nov 13 '18 at 13:29




@ImportanceOfBeingErnest Yes, it is 2.23
– user8314628
Nov 13 '18 at 13:29












If you want someone to find out what's wrong you should be a little more cooperative. The information you provide simply does not suffice to find out anything about the problem. You need a Minimal, Complete, and Verifiable example that other people can run and you need to state how you run it.
– ImportanceOfBeingErnest
Nov 13 '18 at 13:35




If you want someone to find out what's wrong you should be a little more cooperative. The information you provide simply does not suffice to find out anything about the problem. You need a Minimal, Complete, and Verifiable example that other people can run and you need to state how you run it.
– ImportanceOfBeingErnest
Nov 13 '18 at 13:35












1 Answer
1






active

oldest

votes


















0














I also encountered this situation,that caused by ipykernel versions. I change ipykernel from 4.10.0 to 4.9.0.The problem can be solved.






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%2f53272404%2fattributeerror-module-object-has-no-attribute-to-rgba%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









    0














    I also encountered this situation,that caused by ipykernel versions. I change ipykernel from 4.10.0 to 4.9.0.The problem can be solved.






    share|improve this answer

























      0














      I also encountered this situation,that caused by ipykernel versions. I change ipykernel from 4.10.0 to 4.9.0.The problem can be solved.






      share|improve this answer























        0












        0








        0






        I also encountered this situation,that caused by ipykernel versions. I change ipykernel from 4.10.0 to 4.9.0.The problem can be solved.






        share|improve this answer












        I also encountered this situation,that caused by ipykernel versions. I change ipykernel from 4.10.0 to 4.9.0.The problem can be solved.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 29 '18 at 10:27









        PandaOPandaO

        16




        16



























            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.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • 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%2f53272404%2fattributeerror-module-object-has-no-attribute-to-rgba%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







            這個網誌中的熱門文章

            How to read a connectionString WITH PROVIDER in .NET Core?

            In R, how to develop a multiplot heatmap.2 figure showing key labels successfully

            Museum of Modern and Contemporary Art of Trento and Rovereto