[Python-gtkextra-commits] CVS: python-gtkextra2/examples testcontour.py,1.2,1.3 testgtkplot.py,1.8,1
Status: Beta
Brought to you by:
treeves
|
From: <pyt...@li...> - 2003-01-15 18:57:11
|
Update of /cvsroot/python-gtkextra/python-gtkextra2/examples
In directory sc8-pr-cvs1:/tmp/cvs-serv26596/examples
Modified Files:
testcontour.py testgtkplot.py testgtksheet.py testiterator.py
Log Message:
lots more done
Index: testcontour.py
===================================================================
RCS file: /cvsroot/python-gtkextra/python-gtkextra2/examples/testcontour.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** testcontour.py 2 Jan 2003 22:00:45 -0000 1.2
--- testcontour.py 15 Jan 2003 18:57:08 -0000 1.3
***************
*** 7,11 ****
class Application(gtk.Window):
! def __init__(self):
gtk.Window.__init__(self)
self.set_title("Contour Demo")
--- 7,11 ----
class Application(gtk.Window):
! def __init__(self, use_function = 1):
gtk.Window.__init__(self)
self.set_title("Contour Demo")
***************
*** 27,33 ****
canvas.add_plot(plot, 0.16, 0.02)
! surface = gtkextra.PlotCSurface(self.function)
! surface.set_xstep(0.05)
! surface.set_ystep(0.05)
surface.set_legend("cos ((r-r\\s0\\N)\\S2\\N)")
surface.set_gradient(0.2, 0.8, 6, 1)
--- 27,46 ----
canvas.add_plot(plot, 0.16, 0.02)
! nx = 40
! ny = 40
! if use_function:
! surface = gtkextra.PlotCSurface(self.function)
! surface.set_xstep(1.0/nx)
! surface.set_ystep(1.0/ny)
! else:
! x=[]; y=[]; z=[]
! for ix in range(nx):
! for iy in range(ny):
! x.append(ix/float(nx))
! y.append(iy/float(ny))
! z.append(self.function(x[-1], y[-1]))
! surface = gtkextra.PlotCSurface()
! surface.set_points(nx, ny, x=x, y=y, z=z)
!
surface.set_legend("cos ((r-r\\s0\\N)\\S2\\N)")
surface.set_gradient(0.2, 0.8, 6, 1)
***************
*** 41,47 ****
canvas.add_plot(plot, 0.26, 0.56)
! surface = gtkextra.PlotCSurface(self.function)
! surface.set_xstep(0.10)
! surface.set_ystep(0.10)
surface.set_legend("cos ((r-r\\s0\\N)\\S2\\N)")
surface.set_gradient(0.2, 0.8, 6, 1)
--- 54,73 ----
canvas.add_plot(plot, 0.26, 0.56)
! nx = 20
! ny = 20
! if use_function:
! surface = gtkextra.PlotCSurface(self.function)
! surface.set_xstep(1.0/nx)
! surface.set_ystep(1.0/ny)
! else:
! x=[]; y=[]; z=[]
! for ix in range(nx):
! for iy in range(ny):
! x.append(ix/float(nx))
! y.append(iy/float(ny))
! z.append(self.function(x[-1], y[-1]))
! surface = gtkextra.PlotCSurface()
! surface.set_points(nx, ny, x=x, y=y, z=z)
!
surface.set_legend("cos ((r-r\\s0\\N)\\S2\\N)")
surface.set_gradient(0.2, 0.8, 6, 1)
***************
*** 52,56 ****
canvas.export_ps("democsurface.ps", 0, 0, gtkextra.PLOT_LETTER)
- canvas.export_ps("democsurface.ps", 0, 0, gtkextra.PLOT_LETTER)
self.show_all()
--- 78,81 ----
***************
*** 60,64 ****
if __name__ == '__main__':
! app = Application()
app.connect("destroy", lambda win : gtk.main_quit())
gtk.main()
--- 85,89 ----
if __name__ == '__main__':
! app = Application(0)
app.connect("destroy", lambda win : gtk.main_quit())
gtk.main()
Index: testgtkplot.py
===================================================================
RCS file: /cvsroot/python-gtkextra/python-gtkextra2/examples/testgtkplot.py,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** testgtkplot.py 2 Jan 2003 22:00:47 -0000 1.8
--- testgtkplot.py 15 Jan 2003 18:57:08 -0000 1.9
***************
*** 186,190 ****
data.show_yerrbars()
data.set_legend("Spline + EY")
!
data = gtkextra.PlotData()
plot.add_data(data)
--- 186,193 ----
data.show_yerrbars()
data.set_legend("Spline + EY")
! data.show_labels(gtk.TRUE)
! data.set_labels(['0', '1', '2', '3', '4', '5'])
! data.set_labels(['0', '1', '2', '3', '4', '99'])
!
data = gtkextra.PlotData()
plot.add_data(data)
Index: testgtksheet.py
===================================================================
RCS file: /cvsroot/python-gtkextra/python-gtkextra2/examples/testgtksheet.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** testgtksheet.py 2 Jan 2003 22:00:50 -0000 1.2
--- testgtksheet.py 15 Jan 2003 18:57:08 -0000 1.3
***************
*** 654,657 ****
--- 654,660 ----
if __name__ == '__main__':
+ print 'The Python binding for GtkSheet are not complete.'
+ print 'Patches will be accepted if you fix them.'
+ raw_input("Press enter to see what done so far.")
app = Application()
app.connect("destroy", lambda win : gtk.main_quit())
Index: testiterator.py
===================================================================
RCS file: /cvsroot/python-gtkextra/python-gtkextra2/examples/testiterator.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** testiterator.py 14 Jan 2003 15:32:03 -0000 1.2
--- testiterator.py 15 Jan 2003 18:57:08 -0000 1.3
***************
*** 1,4 ****
! #!/usr/env python
!
import sys
--- 1,3 ----
! #!/usr/bin/env python
import sys
|