From: Benjamin R. <ben...@ou...> - 2015-05-07 15:36:37
|
Looks like nabble swallowed your code snippet. Here it is: ``` import matplotlib.pyplot as plt import mpl_toolkits.mplot3d.axes3d as p3 import numpy.random as rnd import numpy as np TILL = 200 # just to have an end in the for loop def SSI(t): #Simulated Serial Input T = np.asarray(t) X = np.sin(T) Y = np.cos(T) return X,Y,T t = range(0,TILL/2) plt.ion() fig = plt.figure() ax = p3.Axes3D(fig) #ax = fig.gca(projection='3d') # same result as Axes3D X,Y,T = SSI(t) g, = ax.plot(X,Y,T) # for set_data method #ax.plot(X,Y,T) # not using set_data method plt.ylim([-1.5,1.5]) plt.xlim([-1.5,1.5]) for i in range(TILL): val = rnd.random(1) t.append(val) t.pop(0) X,Y,T = SSI(t) #plt.plot(X,Y,T) g.set_data(X,Y) # #ax.set_zlim(i,i+100) # to make the time axis sliding plt.draw() #g.axes.figure.canvas.draw() # Same result as plt.draw() ``` Unfortunately, IIRC, set_data() for the 3d objects is probably not what you want. See https://github.com/matplotlib/matplotlib/issues/1483. Ben Root On Sat, May 2, 2015 at 7:05 AM, arjunascagnetto <arj...@gm...> wrote: > hi, > > > I try to make my question as clear as possible. I need to plot 2 > dimensional > data coming from the serial onto a 3d plot with the third axes made of time > flowing. > > I wrote this code (it's just one of the many tries). It's about the > plotting > only, not worring about buffer from serial etc etc... > > > > > With set_data i have a static picture, with ax.plot at every for index I > can't understand what's happening. > > any help would be really appreciate. > > > > -- > View this message in context: > http://matplotlib.1069221.n5.nabble.com/2D-data-plotted-in-a-3D-plot-by-adding-time-flow-dimension-tp45468.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------------ > One dashboard for servers and applications across Physical-Virtual-Cloud > Widest out-of-the-box monitoring support with 50+ applications > Performance metrics, stats and reports that give you Actionable Insights > Deep dive visibility with transaction tracing using APM Insight. > http://ad.doubleclick.net/ddm/clk/290420510;117567292;y > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |