Hello,
Any know if there is an easy way to draw a 3d animated plot, to visualize that kind of function :
z = f(x, y, t)
Thanks in advance
Printable View
Hello,
Any know if there is an easy way to draw a 3d animated plot, to visualize that kind of function :
z = f(x, y, t)
Thanks in advance
Finally I tried something but it didn't work :
Code:
from PyQt4.Qwt3D.ezplot import SurfacePlot from PyQt4.Qwt3D import Function from PyQt4 import Qwt3D, QtCore class MyFunc(Function): def __init__(self, pw): super(MyFunc, self).__init__(pw) self.pw = pw self.t = 0 self.deltaT = 100 qtObject.connect(self.timer, QtCore.SIGNAL("timeout()"), self.updatePW) self.timer.start(self.deltaT) def __call__(self, x, y): print "__call__" return 3 + 4*x**2 - 5*y**2 + self.t def updatePW(self): self.debugCalled = True self.t += self.deltaT/1000 #self.pw.calcNormals() #self.pw.calculateHull() #self.pw.createPoints() #self.pw.createData() #self.pw.updateNormals() #self.pw.updateData() #self.pw.updateGL() #self.pw.update() class Plot(SurfacePlot): def __init__(self): super(Plot, self).__init__() self.myFunc = MyFunc(self) self.myFunc.setMesh(41,31) self.myFunc.setDomain(-1.73, 1.5, -1.5, 1.5) self.myFunc.setMinZ(-10) self.myFunc.create() self.setRotation(30, 0, 15) self.setScale(1, 1, 1) self.setShift(0.15, 0, 0) self.setZoom(0.9) for i in xrange(self.coordinates().axes.size()): self.coordinates().axes[i].setMajors(7) self.coordinates().axes[i].setMinors(3) self.coordinates().axes[Qwt3D.X1].setLabelString("x-axis") self.coordinates().axes[Qwt3D.Y1].setLabelString("y-axis") self.coordinates().axes[Qwt3D.Z1].setLabelString("z-axis") self.setCoordinateStyle(Qwt3D.BOX) #self.updateData() #self.updateGL() if __name__ == "__main__": from PyQt4.QtGui import QApplication import sys plot = Plot() plot.resize(800,600) plot.show() sys.exit(app.exec_())
Every time my funtion updatePW is called, I would like to recalculate the graph data, but I don't know how I could do that, I tried a bound of functions.
Anyone has an idea ?
Thanks in advance
maybe you should take a look into the qwt3d forum at sourceforge. the qwt we are talking about here has nothing to do with qwt3d...