Exemplo n.º 1
0
    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())
Exemplo n.º 2
0
    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())
Exemplo n.º 3
0
 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
Exemplo n.º 4
0
 def distributionStyle(self):
     """@rtype: PlotStyle"""
     style = PlotStyle("Distribution Style")
     style.copyStyleFrom(self._distribution_style)
     style.color = self.currentColor()
     return style
Exemplo n.º 5
0
 def histogramStyle(self):
     """@rtype: PlotStyle"""
     style = PlotStyle("Histogram Style")
     style.copyStyleFrom(self._histogram_style)
     style.color = self.currentColor()
     return style
Exemplo n.º 6
0
 def defaultStyle(self):
     style = PlotStyle("Default Style")
     style.copyStyleFrom(self._default_style)
     style.color = self.currentColor()
     return style
Exemplo n.º 7
0
 def distributionStyle(self):
     """ @rtype: PlotStyle """
     style = PlotStyle("Distribution Style")
     style.copyStyleFrom(self.__distribution_style)
     style.color = self.currentColor()
     return style
Exemplo n.º 8
0
 def histogramStyle(self):
     """ @rtype: PlotStyle """
     style = PlotStyle("Histogram Style")
     style.copyStyleFrom(self.__histogram_style)
     style.color = self.currentColor()
     return style
Exemplo n.º 9
0
 def defaultStyle(self):
     style = PlotStyle("Default Style")
     style.copyStyleFrom(self.__default_style)
     style.color = self.currentColor()
     return style
Exemplo n.º 10
0
 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