# HG changeset patch # User Andrey Skvortsov # Date 1461255268 -10800 # Node ID 7330c85534ead80a2b084caff37ca47716d93f79 # Parent ac8a90b278f110beda25d6a109b466d3425296fb fix set_color_cycle from matplotlib deprecation warning /usr/lib/python2.7/dist-packages/matplotlib/cbook.py:137: MatplotlibDeprecationWarning: The set_color_cycle attribute was deprecated in version 1.5. Use set_prop_cycle instead. warnings.warn(message, mplDeprecation, stacklevel=1) diff -r ac8a90b278f1 -r 7330c85534ea controls/DebugVariablePanel/DebugVariableGraphicViewer.py --- a/controls/DebugVariablePanel/DebugVariableGraphicViewer.py Thu Apr 21 17:51:29 2016 +0300 +++ b/controls/DebugVariablePanel/DebugVariableGraphicViewer.py Thu Apr 21 19:14:28 2016 +0300 @@ -41,6 +41,12 @@ from DebugVariableViewer import * from GraphButton import GraphButton + +from distutils.version import LooseVersion +if LooseVersion(matplotlib.__version__) >= LooseVersion("1.5.0"): + from cycler import cycler + + # Graph variable display type GRAPH_PARALLEL, GRAPH_ORTHOGONAL = range(2) @@ -975,7 +981,13 @@ kwargs["transform"] = self.Axes.transAxes return text_func(*args, **kwargs) return AddText - + + def SetAxesColor(self, color): + if LooseVersion(matplotlib.__version__) >= LooseVersion("1.5.0"): + self.Axes.set_prop_cycle(cycler('color',color)) + else: + self.Axes.set_color_cycle(color) + def ResetGraphics(self): """ Reset figure and graphical elements displayed in it @@ -987,7 +999,7 @@ # Add 3D projection if graph is in 3D if self.Is3DCanvas(): self.Axes = self.Figure.gca(projection='3d') - self.Axes.set_color_cycle(['b']) + self.SetAxesColor(['b']) # Override function to prevent too much refresh when graph is # rotated @@ -1002,7 +1014,7 @@ else: self.Axes = self.Figure.gca() - self.Axes.set_color_cycle(COLOR_CYCLE) + self.SetAxesColor(COLOR_CYCLE) # Set size of X and Y axis labels self.Axes.tick_params(axis='x', labelsize='small')