AttributeError: 'module' object has no attribute 'to_rgba'
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
add a comment |
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
Feel free to provide a Minimal, Complete, and Verifiable example of the issue. Addprint(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
add a comment |
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
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
matplotlib
asked Nov 13 '18 at 1:19
user8314628
54629
54629
Feel free to provide a Minimal, Complete, and Verifiable example of the issue. Addprint(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
add a comment |
Feel free to provide a Minimal, Complete, and Verifiable example of the issue. Addprint(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
add a comment |
1 Answer
1
active
oldest
votes
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.
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
add a comment |
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.
add a comment |
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.
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.
answered Nov 29 '18 at 10:27
PandaO
16
16
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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