← Back to team overview

yade-users team mailing list archive

[Question #668081]: Problem with matplotlib.pyplot

 

New question #668081 on Yade:
https://answers.launchpad.net/yade/+question/668081

Hi all, 

I am using Ubuntu 16.04 and Yade-daily package.

I got this problem when I run a simple "plot":

a=[1,2,3]
b=[2,3,4]
import matplotlib.pyplot as plt
plt.plot(a,b)

---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
/home/son/Desktop/myYade/install/bin/yade in <module>()
      2 b=[2,3,4]
      3 import matplotlib.pyplot as plt
----> 4 plt.plot(a,b)

/usr/lib/pymodules/python2.7/matplotlib/pyplot.pyc in plot(*args, **kwargs)
   2978 @_autogen_docstring(Axes.plot)
   2979 def plot(*args, **kwargs):
-> 2980     ax = gca()
   2981     # allow callers to override the hold state by passing hold=True|False
   2982     washold = ax.ishold()

/usr/lib/pymodules/python2.7/matplotlib/pyplot.pyc in gca(**kwargs)
    801     """
    802 
--> 803     ax =  gcf().gca(**kwargs)
    804     return ax
    805 

/usr/lib/pymodules/python2.7/matplotlib/pyplot.pyc in gcf()
    448         return figManager.canvas.figure
    449     else:
--> 450         return figure()
    451 
    452 fignum_exists = _pylab_helpers.Gcf.has_fignum

/usr/lib/pymodules/python2.7/matplotlib/pyplot.pyc in figure(num, figsize, dpi, facecolor, edgecolor, frameon, FigureClass, **kwargs)
    421                                         frameon=frameon,
    422                                         FigureClass=FigureClass,
--> 423                                         **kwargs)
    424 
    425         if figLabel:

/usr/lib/pymodules/python2.7/matplotlib/backends/backend_tkagg.pyc in new_figure_manager(num, *args, **kwargs)
     77     FigureClass = kwargs.pop('FigureClass', Figure)
     78     figure = FigureClass(*args, **kwargs)
---> 79     return new_figure_manager_given_figure(num, figure)
     80 
     81 

/usr/lib/pymodules/python2.7/matplotlib/backends/backend_tkagg.pyc in new_figure_manager_given_figure(num, figure)
     85     """
     86     _focus = windowing.FocusManager()
---> 87     window = Tk.Tk()
     88     window.withdraw()
     89 

/usr/lib/python2.7/lib-tk/Tkinter.pyc in __init__(self, screenName, baseName, className, useTk, sync, use)
   1760         if baseName is None:
   1761             import os
-> 1762             baseName = os.path.basename(sys.argv[0])
   1763             baseName, ext = os.path.splitext(baseName)
   1764             if ext not in ('.py', '.pyc', '.pyo'):

IndexError: list index out of range

Any help is greatly appreciate!
Thank you :)
Son.

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.