コード例 #1
0
ファイル: style_dialog.py プロジェクト: omad/glue
 def update_style(self):
     if self._edit_label:
         self.layer.label = self.label()
     self.layer.style.color = qt4_to_mpl_color(self.color())
     self.layer.style.alpha = self.color().alpha() / 255.
     self.layer.style.marker = self.symbol()
     self.layer.style.markersize = self.size()
コード例 #2
0
ファイル: style_dialog.py プロジェクト: bmorris3/glue
 def update_style(self):
     if self._edit_label:
         self.layer.label = self.label()
     self.layer.style.color = qt4_to_mpl_color(self.color())
     self.layer.style.alpha = self.color().alpha() / 255.
     self.layer.style.marker = self.symbol()
     self.layer.style.markersize = self.size()
コード例 #3
0
def check_values_and_color(model, data, colors):

    for i in range(len(colors)):

        for j, colname in enumerate(sorted(data)):

            # Get index of cell
            idx = model.index(i, j)

            # Check values
            value = model.data(idx, Qt.DisplayRole)
            assert value == str(data[colname][i])

            # Check colors
            brush = model.data(idx, Qt.BackgroundRole)
            if colors[i] is None:
                assert brush is None
            else:
                assert qt4_to_mpl_color(brush.color()) == colors[i]
コード例 #4
0
ファイル: test_viewer_widget.py プロジェクト: astrofrog/glue
def check_values_and_color(model, data, colors):

    for i in range(len(colors)):

        for j, colname in enumerate('abc'):

            # Get index of cell
            idx = model.index(i, j)

            # Check values
            value = model.data(idx, Qt.DisplayRole)
            assert value == str(data[colname][i])

            # Check colors
            brush = model.data(idx, Qt.BackgroundRole)
            if colors[i] is None:
                assert brush is None
            else:
                assert qt4_to_mpl_color(brush.color()) == colors[i]
コード例 #5
0
ファイル: data_graph.py プロジェクト: harshalkokate/glue
 def color(self):
     return qt4_to_mpl_color(self.pen().color())
コード例 #6
0
ファイル: data_graph.py プロジェクト: harshalkokate/glue
 def color(self):
     return qt4_to_mpl_color(self.node.brush().color())