How to use the plottr.QtGui.QApplication function in plottr

To help you get started, we’ve selected a few plottr examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github data-plottr / plottr / test / apps / custom_app.py View on Github external
def main():
    app = QtGui.QApplication([])

    # flowchart and window
    nodes = makeNodeList()
    win, fc = makeFlowchartWithPlotWindow(nodes)
    win.show()

    # feed in data
    data = makeData()
    fc.setInput(dataIn=data)

    return app.exec_()
github data-plottr / plottr / test / gui / correct_offset.py View on Github external
)
    data.validate()

    x = np.arange(11) - 5.
    y = np.linspace(0, 10, 51)
    xx, yy = np.meshgrid(x, y, indexing='ij')
    zz = np.sin(yy) + xx
    data2 = MeshgridDataDict(
        reps=dict(values=xx),
        y=dict(values=yy),
        z=dict(values=zz, axes=['reps', 'y'])
    )
    data2.validate()

    # make app and gui, fc
    app = QtGui.QApplication([])
    win, fc = flowchartAutoPlot([
        ('sub', SubtractAverage)
    ])
    win.show()

    # feed in data
    fc.setInput(dataIn=data)
    fc.setInput(dataIn=data2)

    return app.exec_()
github data-plottr / plottr / test / gui / simple_2d_plot.py View on Github external
def simple_2d_plot():
    app = QtGui.QApplication([])
    win = PlotWindow()
    plot = AutoPlot(parent=win)
    win.plot.setPlotWidget(plot)
    win.show()

    # plotting 1d traces
    if False:
        logger.info(f"1D trace")
        t0 = time.perf_counter()
        nsamples = 30
        for i in range(nsamples):
            data = datadict_to_meshgrid(
                testdata.get_1d_scalar_cos_data(201, 2)
            )
            win.plot.setData(data)
        t1 = time.perf_counter()
github data-plottr / plottr / test / gui / dimension_assignment.py View on Github external
def dimReduction(interactive=False):
    if not interactive:
        app = QtGui.QApplication([])

    fc = linearFlowchart(('reducer', DimensionReducer))
    reducer = fc.nodes()['reducer']
    dialog = widgetDialog(reducer.ui, 'reducer')

    data = datadict_to_meshgrid(
        testdata.three_compatible_3d_sets(2, 2, 2)
    )
    fc.setInput(dataIn=data)

    if not interactive:
        app.exec_()
    else:
        return dialog, fc
github data-plottr / plottr / test / gui / dimension_assignment.py View on Github external
def xySelection(interactive=False):
    if not interactive:
        app = QtGui.QApplication([])

    fc = linearFlowchart(('xysel', XYSelector))
    selector = fc.nodes()['xysel']
    dialog = widgetDialog(selector.ui, 'xysel')

    data = datadict_to_meshgrid(
        testdata.three_compatible_3d_sets(4, 4, 4)
    )
    fc.setInput(dataIn=data)

    if not interactive:
        app.exec_()
    else:
        return dialog, fc
github data-plottr / plottr / doc / examples / autonode_app.py View on Github external
def main(pathAndId):
    app = QtGui.QApplication([])

    # flowchart and window
    fc = linearFlowchart(
        ('Dataset loader', QCodesDSLoader),
        ('Data selection', DataSelector),
        ('Grid', DataGridder),
        ('Dimension assignment', XYSelector),
        ('Sine fit', sinefit),
        ('plot', PlotNode),
    )

    win = QCAutoPlotMainWindow(fc, pathAndId=pathAndId,
                               loaderName='Dataset loader')
    win.show()

    return app.exec_()
github data-plottr / plottr / plottr / plot / mpl.py View on Github external
def toClipboard(self):
        """
        Copy the current canvas to the clipboard.
        """
        buf = io.BytesIO()
        self.fig.savefig(buf, dpi=300, facecolor='w', format='png',
                         transparent=True)
        QtGui.QApplication.clipboard().setImage(
            QtGui.QImage.fromData(buf.getvalue()))
        buf.close()