We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This snippet:
import matplotlib matplotlib.use('nbagg') from matplotlib import pyplot as plt
Results in this traceback:
--------------------------------------------------------------------------- NameError Traceback (most recent call last) <ipython-input-5-68fd53519d64> in <module>() 1 import matplotlib 2 matplotlib.use('nbagg') ----> 3 from matplotlib import pyplot as plt C:\Miniconda\envs\py34\lib\site-packages\matplotlib\pyplot.py in <module>() 106 107 from matplotlib.backends import pylab_setup --> 108 _backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup() 109 110 C:\Miniconda\envs\py34\lib\site-packages\matplotlib\backends\__init__.py in pylab_setup() 30 # imports. 0 means only perform absolute imports. 31 backend_mod = __import__(backend_name, ---> 32 globals(),locals(),[backend_name],0) 33 34 # Things we pull in from all backends C:\Miniconda\envs\py34\lib\site-packages\matplotlib\backends\backend_nbagg.py in <module>() 10 11 from matplotlib.figure import Figure ---> 12 from matplotlib.backends.backend_webagg_core import (FigureManagerWebAgg, 13 FigureCanvasWebAggCore, 14 NavigationToolbar2WebAgg) C:\Miniconda\envs\py34\lib\site-packages\matplotlib\backends\backend_webagg_core.py in <module>() 239 240 --> 241 class NavigationToolbar2WebAgg(backend_bases.NavigationToolbar2): 242 _jquery_icon_classes = { 243 'home': 'ui-icon ui-icon-home', C:\Miniconda\envs\py34\lib\site-packages\matplotlib\backends\backend_webagg_core.py in NavigationToolbar2WebAgg() 255 for text, tooltip_text, image_file, name_of_method 256 in (backend_bases.NavigationToolbar2.toolitems + --> 257 (('Download', 'Download plot', 'download', 'download'),)) 258 if image_file in _jquery_icon_classes] 259 C:\Miniconda\envs\py34\lib\site-packages\matplotlib\backends\backend_webagg_core.py in <listcomp>(.0) 256 in (backend_bases.NavigationToolbar2.toolitems + 257 (('Download', 'Download plot', 'download', 'download'),)) --> 258 if image_file in _jquery_icon_classes] 259 260 def _init_toolbar(self): NameError: name '_jquery_icon_classes' is not defined
And this, I believe, is why:
http://stackoverflow.com/questions/13905741/accessing-class-variables-from-a-list-comprehension-in-the-class-definition
Thanks!
The text was updated successfully, but these errors were encountered:
cc @pelson @mdboom
Sorry, something went wrong.
Confirmed on both 3.3 and 3.4, everything works as expected on Python 2.7.
I tried to solve the issue in a hacky way just replacing the variable names with their contents, but still everything I see is a blank plot.
Yes, @stahlous is right. The simplest is probably to rewrite the list comprehensions as regular for loops.
BUG : fix list comprehensions over class members
126fb9c
Due to scoping fixes in py3k, list comprehensions over class level attributes during class definition does not work (see http://stackoverflow.com/questions/13905741/accessing-class-variables-from-a-list-comprehension-in-the-class-definition). Superficially Fixes matplotlib#3436. There seem to be other issues
No branches or pull requests
This snippet:
Results in this traceback:
And this, I believe, is why:
http://stackoverflow.com/questions/13905741/accessing-class-variables-from-a-list-comprehension-in-the-class-definition
Thanks!
The text was updated successfully, but these errors were encountered: