def __init__(self, parent=None): """ :param parent: Parent QWidget """ super(ArrayStackPlot, self).__init__(parent) self.__signal = None self.__signal_name = None # the Z, Y, X axes apply to the last three dimensions of the signal # (in that order) self.__z_axis = None self.__z_axis_name = None self.__y_axis = None self.__y_axis_name = None self.__x_axis = None self.__x_axis_name = None self._stack_view = StackView(self) self._hline = qt.QFrame(self) self._hline.setFrameStyle(qt.QFrame.HLine) self._hline.setFrameShadow(qt.QFrame.Sunken) self._legend = qt.QLabel(self) self._selector = NumpyAxesSelector(self) self._selector.setNamedAxesSelectorVisibility(False) self.__selector_is_connected = False layout = qt.QVBoxLayout() layout.addWidget(self._stack_view) layout.addWidget(self._hline) layout.addWidget(self._legend) layout.addWidget(self._selector) self.setLayout(layout)
def setUp(self): super(TestStackView, self).setUp() self.stackview = StackView() self.stackview.show() self.qWaitForWindowExposed(self.stackview) self.mystack = numpy.fromfunction( lambda i, j, k: numpy.sin(i / 15.) + numpy.cos(j / 4.) + 2 * numpy. sin(k / 6.), (10, 20, 30))
def _createStackView(self): plot = StackView(self) self.stack = plot toolBar = toolbar.ProfileToolBar(plot, plot.getPlotWidget()) toolBar.setScheme("imagestack") plot.addToolBar(toolBar) toolBar = plot.getProfileToolbar() toolBar.clear()
def plot3Dsilx(nodeData): from silx.gui.plot import StackView saveType = nodeData[0] plot = StackView() plot.setColormap('viridis') plot.setGraphTitle(nodeData[1] + ' ' + saveType) plot.setLabels(nodeData[3]) savedColumns = nodeData[4] for fname, props in savedColumns.items(): maps = read3D(saveType, fname, props) # applied only to one (first) 3D map: v = maps[0] plot.setStack(v) # plot.saveGraph('test.png') plot.show() # end plot3Dsilx