1

Sorry for the second post , but I wanted to include the errors I'm getting.

"import matplotlib" works. get_backend() retuns "TkAgg"( change made in RC file)

but "import matplotlib.pyplot as plt returns: Python 3.4.2 (default, Oct 19 2014, 13:31:11) [GCC 4.9.1] on linux Type "help", "copyright", "credits" or "license" for more information.

import matplotlib.pyplot as plt Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python3.4/dist-packages/matplotlib-1.5.0-py3.4-linux-armv7l.egg/matplotlib/pyplot.py", line 114, in _backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup() File "/usr/local/lib/python3.4/dist-packages/matplotlib-1.5.0-py3.4-linux-armv7l.egg/matplotlib/backends/init.py", line 32, in pylab_setup globals(),locals(),[backend_name],0) File "/usr/local/lib/python3.4/dist-packages/matplotlib-1.5.0-py3.4-linux-armv7l.egg/matplotlib/backends/backend_tkagg.py", line 13, in import matplotlib.backends.tkagg as tkagg File "/usr/local/lib/python3.4/dist-packages/matplotlib-1.5.0-py3.4-linux-armv7l.egg/matplotlib/backends/tkagg.py", line 9, in from matplotlib.backends import _tkagg ImportError: cannot import name '_tkagg'

8
  • 1
    @bobsterman any sequence should work as input to plot
    – tacaswell
    Dec 24, 2015 at 18:21
  • what does plt.get_backend() return? My guess is it has defaulted to Agg which is a non-interactive backend. Dose plt.save_fig('test.png') do the right thing?
    – tacaswell
    Dec 24, 2015 at 18:22
  • @tcaswell yes to both of your questions, "Agg" and image file was created. Id this something that can be changed in a confiig file? Or is it a build issue? TX David Dec 24, 2015 at 21:54
  • either modify your matplotlibrc file or import matplotlib; matplotlib.use('tkagg'); import matplotlib.pyplot as plt. It is important to call use before you import pyplot
    – tacaswell
    Dec 24, 2015 at 22:09
  • See, matplotlib.org/faq/usage_faq.html#what-is-a-backend Which interactive backends are available will depended on what else is installed on your system
    – tacaswell
    Dec 24, 2015 at 22:10

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.