示例#1
0
 def plfbox(x0, y0):
     x = numpy.array([x0, x0, x0 + 1.0, x0 + 1.0])
     y = numpy.array([0.0, y0, y0, 0.0])
     plplot.plfill(x, y)
     plplot.plcol0(1)
     plplot.pllsty(1)
     plplot.plline(x, y)
示例#2
0
    def plotCurves(self):
        self.plot.clearWidget()

        # 1st plot
        indexes = numpy.arange(0, 360.1, 1.0)
        sine = numpy.sin(indexes * 3.14159 / 180.0)
        cosine = numpy.cos(indexes * 3.14159 / 180.0)

        plplot.pladv(0)
        plplot.plvpor(0.05, 0.95, 0.05, 0.45)
        plplot.plwind(0.0, 360.0, -1.2, 1.2)

	plplot.plcol0(2)
	plplot.plbox("bcnst", 0., 0, "bcnst", 0., 0)
	
	plplot.plcol0(1)
	plplot.plwidth(2)
	plplot.plline(indexes, sine)
	
	plplot.plcol0(3)
	plplot.plwidth(1)
	plplot.pllsty(2)
	plplot.plline(indexes, cosine)
	plplot.pllsty(1)

	plplot.plcol0(2)
	
	plplot.plmtex("t", 1., 0.5, 0.5, "Sines")

        # 2nd plot
        indexes = numpy.arange(-1.0, 1.0, 0.01)
        square = indexes * indexes
        cubic = square * indexes

	plplot.plvpor(0.05, 0.95, 0.55, 0.95)
	plplot.plwind(-1., 1., -1., 1.)
	
	plplot.plcol0(2)
	plplot.plbox("bcnst", 0., 0, "bcnst", 0., 0)
	
	plplot.plcol0(1)
	plplot.plwidth(2)
	plplot.plline(indexes, square)
	
	plplot.plcol0(3)
	plplot.plwidth(1)
	plplot.pllsty(2)
	plplot.plline(indexes, cubic)
	plplot.pllsty(1)
	
	plplot.plcol0(2)
	
	plplot.plmtex("t", 1., 0.5, 0.5, "Square & Cubic")

        self.update()