def __init__(self): QtGui.QMainWindow.__init__(self, None) # UI setup self.curvesAct = QtGui.QAction("Curves", self) self.histogramAct = QtGui.QAction("Histogram", self) self.interactiveAct = QtGui.QAction("Interactive Selection", self) self.plotMenu = self.menuBar().addMenu("Plot") self.plotMenu.addAction(self.curvesAct) self.plotMenu.addAction(self.histogramAct) self.plotMenu.addAction(self.interactiveAct) self.connect(self.curvesAct, QtCore.SIGNAL("triggered()"), self.plotCurves) self.connect(self.histogramAct, QtCore.SIGNAL("triggered()"), self.plotHistogram) self.connect(self.interactiveAct, QtCore.SIGNAL("triggered()"), self.interactive) # PLplot setup self.plot = plplot_pyqt4.QtExtWidget(842, 595, self) self.setCentralWidget(self.plot) plplot_pyqt4.plsetqtdev(self.plot) plplot.plsdev("extqt") plplot.plinit() self.resize(600, 600) plplot.pladv(0)
def Init(self): print " init \n" if (hasattr(plplot, "semaphore")): if (plplot.owner is not self): plplot.semaphore.acquire() plplot.owner = self plplot.plsdev("xwin") plplot.plsxwin(self.winId()) plplot.plspause(0) plplot.plinit() plplot.plbop() if (hasattr(plplot, "semaphore")): plplot.semaphore.release()
def Init(self): print " init \n" if(hasattr(plplot,"semaphore")): if(plplot.owner is not self): plplot.semaphore.acquire() plplot.owner=self plplot.plsdev("xwin") plplot.plsxwin(self.winId()) plplot.plspause(0) plplot.plinit() plplot.plbop() if(hasattr(plplot,"semaphore")): plplot.semaphore.release()
def __init__(self): QtGui.QMainWindow.__init__(self, None) # UI setup self.curvesAct = QtGui.QAction("Curves", self) self.histogramAct = QtGui.QAction("Histogram", self) self.interactiveAct = QtGui.QAction("Interactive Selection", self) self.plotMenu = self.menuBar().addMenu("Plot") self.plotMenu.addAction(self.curvesAct) self.plotMenu.addAction(self.histogramAct) self.plotMenu.addAction(self.interactiveAct) self.connect(self.curvesAct, QtCore.SIGNAL("triggered()"), self.plotCurves) self.connect(self.histogramAct, QtCore.SIGNAL("triggered()"), self.plotHistogram) self.connect(self.interactiveAct, QtCore.SIGNAL("triggered()"), self.interactive) # PLplot setup self.plot = plplot_pyqt4.QtExtWidget(842, 595, self) self.setCentralWidget(self.plot) plplot_pyqt4.plsetqtdev(self.plot) plplot.plsdev("extqt") plplot.plinit() self.resize(600,600) plplot.pladv(0)
# unicode in the range from 0 to 255 directly as Type1 font indices) and # if the -dev ps -drvopt hrshsym=0 command-line options are used, then # the results are similar to the results obtained from the historical # gfontview application that is no longer available under Linux. # Append to effective python path so that can find plplot modules. from plplot_python_start import * import sys import plplot as w # Parse and process command line arguments w.plparseopts(sys.argv, w.PL_PARSE_FULL) # Initialize plplot w.plinit() # main # # Displays all available Type1 glyphs. family = ( "sans-serif", "serif", "monospace", "script", "symbol", ) style = ( "upright", "italic",
""" Example of plotting lines with pyvisi This is the original code used to develop the plplot renderer module """ # set up some data to plot from Numeric import * x = arange(10, typecode=Float) y = x**2 import plplot plplot.plsdev("xwin") plplot.plinit() plplot.plenv(min(x), max(x), min(y), max(y), 0, 1) plplot.pllab("x", "x**2", "Example 2D plot") plplot.plline(x, y) plplot.plend() # to save as well, have to set everything up again, and replot # save as png plplot.plsdev("png") plplot.plsfnam("simplePlotExample.png") plplot.plinit() plplot.plenv(min(x), max(x), min(y), max(y), 0, 1) plplot.pllab("x", "x**2", "Example 2D plot") plplot.plline(x, y) plplot.plend()
def pgopen(device): if PLPLOT: plg.plsdev(device) plg.plinit() else: plg.pgopen(device)
def main(w): geometry_master = "500x410+100+200" geometry_slave = "500x410+650+200" driver = w.plgdev() (fam, num, bmax) = w.plgfam() print "Demo of multiple output streams via the %s driver." % driver print "Running with the second stream as slave to the first." print "" # Set up the first stream. w.plsetopt("geometry", geometry_master) w.plsdev(driver) w.plssub(2, 2) w.plinit() # Start next stream. w.plsstrm(1) # Turn off pause to make this a slave (must follow master) w.plsetopt("geometry", geometry_slave) w.plspause(0) w.plsdev(driver) w.plsfam(fam, num, bmax) w.plsetopt("fflen", "2") w.plinit() # Set up the data & plot # Original case w.plsstrm(0) xscale = 6. yscale = 1. xoff = 0. yoff = 0. plot1(w, xscale, yscale, xoff, yoff) # Set up the data & plot xscale = 1. yscale = 1.e+6 plot1(w, xscale, yscale, xoff, yoff) # Set up the data & plot xscale = 1. yscale = 1.e-6 digmax = 2 w.plsyax(digmax, 0) plot1(w, xscale, yscale, xoff, yoff) # Set up the data & plot xscale = 1. yscale = 0.0014 yoff = 0.0185 digmax = 5 w.plsyax(digmax, 0) plot1(w, xscale, yscale, xoff, yoff) # To slave # The w.pleop() ensures the eop indicator gets lit. w.plsstrm(1) plot4(w) w.pleop() # Back to master w.plsstrm(0) plot2(w) plot3(w) # To slave w.plsstrm(1) plot5(w) w.pleop() # Back to master to wait for user to advance w.plsstrm(0) w.pleop()