def __init__(self, limit_to=None, parent=None, show=True): self.__version__ = sciplot.__version__ self.list_ids = [] self.list_all = [] # There are a number of changes and deprectaion # in MPL v2; thus, this will be tracked # so MPL 1 and 2 can be used seemlessly self._mpl_v2 = int(_mpl.__version__.rsplit('.')[0]) == 2 # Check to see if QApp already exists # if not, one has to be created self.app = None if _QApplication.instance() is None: print('\nNo QApplication instance (this is common with certain \ version of Matplotlib). Creating one.\n\r\ You will need to exec manually after you finish plotting.\n\ -----------Example---------------\n\ import sciplot\n\ sp = sciplot.main()\n\n\ # Plot a line\n\ sp.plot((0,1),(0,1))\n\n\ # Start the QApplication\n\ sp.app.exec_()') self.app = _QApplication(_sys.argv) self.app.setQuitOnLastWindowClosed(True) self.setup(limit_to=limit_to, parent=parent) if show: self.show()
def __init__(self, limit_to=None, parent=None, show=True): self.list_ids = [] self.list_all = [] # Check to see if QApp already exists # if not, one has to be created if _QApplication.instance() is None: self.app = _QApplication(_sys.argv) self.app.setQuitOnLastWindowClosed(True) self.setup(limit_to=limit_to, parent=parent) if show: self.show()
def main(args=None): """ The main routine. """ if args is None: args = _sys.argv[1:] print('Starting up sciplot...') app = _QApplication(_sys.argv) app.setStyle('Cleanlooks') win = sciplotUI.SciPlotUI() ### EDIT ### win.showMaximized() app.exec_()
def main(args=None): """ The main routine. """ if args is None: args = _sys.argv[1:] print('Starting up crikit2...') app = _QApplication(_sys.argv) app.setStyle('Cleanlooks') win = CRIkitUI.CRIkitUI_process() ### EDIT ### win.showMaximized() app.exec_()
def main(args=None): """ The main routine. """ if args is None: args = _sys.argv[1:] print('Starting up crikit2...') app = _QApplication(_sys.argv) app.setStyle('Cleanlooks') has_requirements = check_requirements() if has_requirements: win = CRIkitUI.CRIkitUI_process() ### EDIT ### win.showMaximized() app.exec_() else: print('Closing... need to upgrade libraries') app.quit()
self.ui.modelTabWidget.setCurrentIndex(0) # Add a calendar to the toolBox and have it displayed initially cal2 = _QCalendarWidget() self.ui.toolBox.addItem(cal2, 'Add-On Toolbox Tab') self.ui.toolBox.setCurrentIndex(self.ui.toolBox.count()-1) # Adjust with of groupBox to accomodate new widget (10% larger than) width = cal2.sizeHint().width() self.ui.groupBox.setMinimumWidth(1.1*width) self.ui.groupBox.setMaximumWidth(1.1*width) self.ui.groupBox.updateGeometry() if __name__ == '__main__': app = _QApplication(_sys.argv) winPlotter = SciPlotAddon(limit_to=['bars']) winPlotter.show() x = _np.arange(100) y = x**2 # winPlotter.plot(x, y, x_label='X', label='Plot') # winPlotter.plot(x, y**1.1, label='Plot 2') # winPlotter.fill_between(x, y-1000, y+1000, label='Fill Between') # # winPlotter.imshow(_np.random.randn(100,100), label='Imshow') # winPlotter.bar(x[::10],y[::10],label='Bar') # winPlotter.hist(y,label='Hist')
excl_list = [q.strip() for q in excl_str.split(',') if q.strip()] dset_list = [ self.ui.listDataSet.item(num).text() for num in range(self.ui.listDataSet.count()) ] if incl_list: # Include list is not empty dset_list = filterlist(dset_list, incl_list, keep_filtered_items=True, exclusive=HdfLoad.config['excl_filtering']) if excl_list: # Exclude list is not empty dset_list = filterlist(dset_list, excl_list, keep_filtered_items=False, exclusive=HdfLoad.config['excl_filtering']) self.ui.listDataSet.clear() self.ui.listDataSet.addItems(dset_list) if __name__ == '__main__': # pragma: no cover app = _QApplication(_sys.argv) # pylint: disable=C0103 result = HdfLoad.getFileDataSets(pth='.', title='Test title') # pylint: disable=C0103 print('Result: {}'.format(result)) _sys.exit() # pylint: error
def start(): app = _QApplication(_sys.argv) ex = _GUIMainWindow() ex.show() _sys.exit(app.exec_())