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











up vote
0
down vote

favorite












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 at 13:25










  • @ImportanceOfBeingErnest Yes, it is 2.23
    – user8314628
    Nov 13 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 at 13:35















up vote
0
down vote

favorite












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 at 13:25










  • @ImportanceOfBeingErnest Yes, it is 2.23
    – user8314628
    Nov 13 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 at 13:35













up vote
0
down vote

favorite









up vote
0
down vote

favorite











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 at 1:19









user8314628

47829




47829












  • 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 at 13:25










  • @ImportanceOfBeingErnest Yes, it is 2.23
    – user8314628
    Nov 13 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 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 at 13:25










  • @ImportanceOfBeingErnest Yes, it is 2.23
    – user8314628
    Nov 13 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 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 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 at 13:25












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




@ImportanceOfBeingErnest Yes, it is 2.23
– user8314628
Nov 13 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 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 at 13:35

















active

oldest

votes











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%2f53272404%2fattributeerror-module-object-has-no-attribute-to-rgba%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















 

draft saved


draft discarded



















































 


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







Popular posts from this blog

How to send String Array data to Server using php in android

Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

Is anime1.com a legal site for watching anime?