Exemple #1
0
 def test_auto_interval_max_ticks(self):
     data_low = 0.
     data_high = 100.
     for max_ticks in range(4, 11):
         interval = auto_interval(data_low=data_low, data_high=data_high,
                                  max_ticks=max_ticks)
         num_ticks = int((data_high - data_low) / interval)
         self.assertGreaterEqual(num_ticks, 3)
         self.assertLessEqual(num_ticks, max_ticks)
Exemple #2
0
 def test_auto_interval_max_ticks(self):
     data_low = 0.
     data_high = 100.
     for max_ticks in range(4, 11):
         interval = auto_interval(
             data_low=data_low, data_high=data_high, max_ticks=max_ticks)
         num_ticks = int((data_high - data_low) / interval)
         self.assertGreaterEqual(num_ticks, 3)
         self.assertLessEqual(num_ticks, max_ticks)
Exemple #3
0
    def test_default_auto_interval(self):
        """test default interval computation range orders of magnitude

        By default, the interval tries to pick eye-friendly intervals so that
        there are between 2 and 8 tick marks.
        """
        data_low = 0.
        for i in range(30):
            data_high = 10.**(i / 10.)
            interval = auto_interval(data_low=data_low, data_high=data_high)
            num_ticks = int((data_high - data_low) / interval)
            self.assertGreaterEqual(num_ticks, 3)
            self.assertLessEqual(num_ticks, 8)
Exemple #4
0
    def test_default_auto_interval(self):
        """test default interval computation range orders of magnitude

        By default, the interval tries to pick eye-friendly intervals so that
        there are between 2 and 8 tick marks.
        """
        data_low = 0.
        for i in range(30):
            data_high = 10. ** (i / 10.)
            interval = auto_interval(data_low=data_low, data_high=data_high)
            num_ticks = int((data_high - data_low) / interval)
            self.assertGreaterEqual(num_ticks, 3)
            self.assertLessEqual(num_ticks, 8)