Exemplo n.º 1
0
def plot_class_limits(axis, y):
    class_limits = model.get_class_pmr_limits()
    for limit in class_limits:
        plt.axvline(limit, color='y', linewidth=2)

    bbox = {'facecolor': 'yellow', 'alpha': 0.5, 'pad': 4, 'linewidth': 0}
    axis.text(0,
              y,
              'class-1',
              style='italic',
              color='r',
              bbox=bbox,
              horizontalalignment='left',
              verticalalignment='top',
              alpha=0.8)
    axis.text(class_limits[0],
              y,
              'class-2',
              style='italic',
              color='r',
              bbox=bbox,
              horizontalalignment='left',
              verticalalignment='bottom',
              alpha=0.8)
    axis.text(class_limits[1],
              y,
              'class-3',
              style='italic',
              color='r',
              bbox=bbox,
              horizontalalignment='left',
              verticalalignment='top',
              alpha=0.8)
Exemplo n.º 2
0
Arquivo: plots.py Projeto: JRCSTU/wltp
def plot_class_limits(axis, y):
    class_limits = model.get_class_pmr_limits()
    for limit in class_limits:
        plt.axvline(limit, color='y', linewidth=2)

    bbox = {'facecolor':'yellow', 'alpha':0.5, 'pad':4, 'linewidth':0}
    axis.text(0, y, 'class-1', style='italic', color='r',
        bbox=bbox, horizontalalignment='left', verticalalignment='top', alpha=0.8)
    axis.text(class_limits[0], y, 'class-2', style='italic', color='r',
        bbox=bbox, horizontalalignment='left', verticalalignment='bottom', alpha=0.8)
    axis.text(class_limits[1], y, 'class-3', style='italic', color='r',
        bbox=bbox, horizontalalignment='left', verticalalignment='top', alpha=0.8)
Exemplo n.º 3
0
 def test_get_class_pmr_limits_with_edges(self):
     pmr_limits = model.get_class_pmr_limits(edges=True)
     self.assertEqual(pmr_limits[0], 0, 'Left-edge not 0!')
     self.assertEqual(pmr_limits[-1], float('inf'),
                      'PMR-limit: Right-edge not INF!')
Exemplo n.º 4
0
 def test_get_class_pmr_limits(self):
     l = model.get_class_pmr_limits()
     self.assertSequenceEqual(l, [22, 34])
Exemplo n.º 5
0
 def test_get_class_pmr_limits_with_edges(self):
     pmr_limits = model.get_class_pmr_limits(edges=True)  
     self.assertEqual(pmr_limits[0], 0, 'Left-edge not 0!')
     self.assertEqual(pmr_limits[-1], float('inf'), 'PMR-limit: Right-edge not INF!')
Exemplo n.º 6
0
 def test_get_class_pmr_limits(self):
     l = model.get_class_pmr_limits()
     self.assertSequenceEqual(l, [22, 34])