def test_plot_style_builtin_checks(self): style = PlotStyle("Test") style.name = None self.assertIsNone(style.name) style.color = "notacolor" self.assertEqual( style.color, "notacolor") # maybe make this a proper check in future ? style.line_style = None self.assertEqual(style.line_style, "") style.marker = None self.assertEqual(style.marker, "") style.width = -1 self.assertEqual(style.width, 0.0) style.size = -1 self.assertEqual(style.size, 0.0) style.alpha = 1.1 self.assertEqual(style.alpha, 1.0) style.alpha = -0.1 self.assertEqual(style.alpha, 0.0) style.setEnabled(False) self.assertFalse(style.isEnabled())
def test_plot_style_builtin_checks(self): style = PlotStyle("Test") style.name = None self.assertIsNone(style.name) style.color = "notacolor" self.assertEqual(style.color, "notacolor") # maybe make this a proper check in future ? style.line_style = None self.assertEqual(style.line_style, "") style.marker = None self.assertEqual(style.marker, "") style.width = -1 self.assertEqual(style.width, 0.0) style.size = -1 self.assertEqual(style.size, 0.0) style.alpha = 1.1 self.assertEqual(style.alpha, 1.0) style.alpha = -0.1 self.assertEqual(style.alpha, 0.0) style.setEnabled(False) self.assertFalse(style.isEnabled())
def getStatisticsStyle(self, statistic): style = self._statistics_style[statistic] copy_style = PlotStyle(style.name) copy_style.copyStyleFrom(style) copy_style.color = self.currentColor() return copy_style
def distributionStyle(self): """@rtype: PlotStyle""" style = PlotStyle("Distribution Style") style.copyStyleFrom(self._distribution_style) style.color = self.currentColor() return style
def histogramStyle(self): """@rtype: PlotStyle""" style = PlotStyle("Histogram Style") style.copyStyleFrom(self._histogram_style) style.color = self.currentColor() return style
def defaultStyle(self): style = PlotStyle("Default Style") style.copyStyleFrom(self._default_style) style.color = self.currentColor() return style
def distributionStyle(self): """ @rtype: PlotStyle """ style = PlotStyle("Distribution Style") style.copyStyleFrom(self.__distribution_style) style.color = self.currentColor() return style
def histogramStyle(self): """ @rtype: PlotStyle """ style = PlotStyle("Histogram Style") style.copyStyleFrom(self.__histogram_style) style.color = self.currentColor() return style
def defaultStyle(self): style = PlotStyle("Default Style") style.copyStyleFrom(self.__default_style) style.color = self.currentColor() return style
def getStatisticsStyle(self, statistic): style = self.__statistics_style[statistic] copy_style = PlotStyle(style.name) copy_style.copyStyleFrom(style) copy_style.color = self.currentColor() return copy_style