controls/DebugVariablePanel/DebugVariableGraphicViewer.py
changeset 1919 ccea0fa6ea91
parent 1878 fb73a6b6622d
child 1973 cc7a46953471
equal deleted inserted replaced
1918:e7b6478b4ebc 1919:ccea0fa6ea91
    24 
    24 
    25 
    25 
    26 from __future__ import absolute_import
    26 from __future__ import absolute_import
    27 from types import TupleType
    27 from types import TupleType
    28 from time import time as gettime
    28 from time import time as gettime
    29 from distutils.version import LooseVersion
    29 from cycler import cycler
    30 
    30 
    31 import numpy
    31 import numpy
    32 import wx
    32 import wx
    33 import matplotlib
    33 import matplotlib
    34 import matplotlib.pyplot
    34 import matplotlib.pyplot
    38 from mpl_toolkits.mplot3d import Axes3D
    38 from mpl_toolkits.mplot3d import Axes3D
    39 
    39 
    40 from editors.DebugViewer import REFRESH_PERIOD
    40 from editors.DebugViewer import REFRESH_PERIOD
    41 from controls.DebugVariablePanel.DebugVariableViewer import *
    41 from controls.DebugVariablePanel.DebugVariableViewer import *
    42 from controls.DebugVariablePanel.GraphButton import GraphButton
    42 from controls.DebugVariablePanel.GraphButton import GraphButton
    43 
       
    44 
       
    45 if LooseVersion(matplotlib.__version__) >= LooseVersion("1.5.0"):
       
    46     from cycler import cycler
       
    47 
    43 
    48 
    44 
    49 # Graph variable display type
    45 # Graph variable display type
    50 GRAPH_PARALLEL, GRAPH_ORTHOGONAL = range(2)
    46 GRAPH_PARALLEL, GRAPH_ORTHOGONAL = range(2)
    51 
    47 
   981             kwargs["transform"] = self.Axes.transAxes
   977             kwargs["transform"] = self.Axes.transAxes
   982             return text_func(*args, **kwargs)
   978             return text_func(*args, **kwargs)
   983         return AddText
   979         return AddText
   984 
   980 
   985     def SetAxesColor(self, color):
   981     def SetAxesColor(self, color):
   986         if LooseVersion(matplotlib.__version__) >= LooseVersion("1.5.0"):
   982         self.Axes.set_prop_cycle(cycler('color', color))
   987             self.Axes.set_prop_cycle(cycler('color', color))
       
   988         else:
       
   989             self.Axes.set_color_cycle(color)
       
   990 
   983 
   991     def ResetGraphics(self):
   984     def ResetGraphics(self):
   992         """
   985         """
   993         Reset figure and graphical elements displayed in it
   986         Reset figure and graphical elements displayed in it
   994         Called any time list of items or graph type change
   987         Called any time list of items or graph type change