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?
matplotlib
add a comment |
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?
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 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
add a comment |
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?
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 at 1:19
user8314628
47829
47829
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 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
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 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
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
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 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