From: Zlatan T on 26 Mar 2010 15:07 Hi, I have a matrix containing a time series of PDFs. That is, on day 1 there is one specific PDF, on day 2 there is a slightly different PDF, etc. I would like to create a 3D plot to visualize the evolution of this PDF function over time. I have looked at both waterfall() and ribbon() 3D plots. ribbon() is close, but it is not exactly what I am looking for. I will have many points in the time series (~1000) so the ribbon() plot will not look good with that many points. Instead, I would like for the plot to be a "series of surface plots." That is, the 1st surface would be the (flat) surface defined by the t=0 axis line and the PDF at t = 0. The second surface would be the flat surface defined by the t=1 line and the PDF at t = 1, etc. I attempted to do this using plot3() to plot the PDFs as well as their shading lines, but this does not look good in 3D because the shading lines in the background (which should not be seen) show up on the plot. If you have JSTOR, the type of plot I am looking for is in Figure 10 of the paper by Bates. http://www.jstor.org/stable/pdfplus/2328552.pdf Does anyone know how to produce this sort of plot? Thanks
From: us on 26 Mar 2010 15:20 "Zlatan T" <ibra1121(a)gmail.com> wrote in message <hoj0ko$5e0$1(a)fred.mathworks.com>... > Hi, > > I have a matrix containing a time series of PDFs. That is, on day 1 there is one specific PDF, on day 2 there is a slightly different PDF, etc. > > I would like to create a 3D plot to visualize the evolution of this PDF function over time. I have looked at both waterfall() and ribbon() 3D plots. ribbon() is close, but it is not exactly what I am looking for. I will have many points in the time series (~1000) so the ribbon() plot will not look good with that many points. > > Instead, I would like for the plot to be a "series of surface plots." That is, the 1st surface would be the (flat) surface defined by the t=0 axis line and the PDF at t = 0. The second surface would be the flat surface defined by the t=1 line and the PDF at t = 1, etc. I attempted to do this using plot3() to plot the PDFs as well as their shading lines, but this does not look good in 3D because the shading lines in the background (which should not be seen) show up on the plot. > > If you have JSTOR, the type of plot I am looking for is in Figure 10 of the paper by Bates. > > http://www.jstor.org/stable/pdfplus/2328552.pdf > > Does anyone know how to produce this sort of plot? > > Thanks a hint: help plot3; % <- does exactly what you want... % create some X/Y/Z data... [x,y]=meshgrid(0:10:360,0:.1:pi); z=sind(x)+x.*cos(2*y); plot3(x,y,z,'-k'); view(45,45); us
From: Alan B on 26 Mar 2010 16:28 "Zlatan T" <ibra1121(a)gmail.com> wrote in message <hoj0ko$5e0$1(a)fred.mathworks.com>... > Hi, > > I have a matrix containing a time series of PDFs. That is, on day 1 there is one specific PDF, on day 2 there is a slightly different PDF, etc. > > I would like to create a 3D plot to visualize the evolution of this PDF function over time. I have looked at both waterfall() and ribbon() 3D plots. ribbon() is close, but it is not exactly what I am looking for. I will have many points in the time series (~1000) so the ribbon() plot will not look good with that many points. > > Instead, I would like for the plot to be a "series of surface plots." That is, the 1st surface would be the (flat) surface defined by the t=0 axis line and the PDF at t = 0. The second surface would be the flat surface defined by the t=1 line and the PDF at t = 1, etc. I attempted to do this using plot3() to plot the PDFs as well as their shading lines, but this does not look good in 3D because the shading lines in the background (which should not be seen) show up on the plot. > > If you have JSTOR, the type of plot I am looking for is in Figure 10 of the paper by Bates. > > http://www.jstor.org/stable/pdfplus/2328552.pdf > > Does anyone know how to produce this sort of plot? > > Thanks You could use a single surf() call but it won't look quite the same. If you use multiple calls to surf, each with a small x offset from the previous, you can set each sheet's facecolor to white, and edgecolor to black (or whatever) to get the same sort of "hidden sheet" effect. You would have to add a zero row to each of your z vectors, to make the data represent a 2D surface.
From: Zlatan T on 27 Mar 2010 23:34 thanks Alan, surf() was what I needed. Heres what I ended up doing in case anyone is looking to do the same thing. X = (-5:.1:5); Y = normpdf(X); Xsurf = [X ; X]; Ysurf = [zeros(1,length(Y)) ; Y]; Z = ones(size(Xsurf)); surf(Xsurf,Ysurf,Z) hold on X = (-5:.1:5); Y = normpdf(X,3,1); Xsurf = [X ; X]; Ysurf = [zeros(1,length(Y)) ; Y]; Z = 2*ones(size(Xsurf)); surf(Xsurf,Ysurf,Z) X = (-5:.1:5); Y = normpdf(X,-2,1); Xsurf = [X ; X]; Ysurf = [zeros(1,length(Y)) ; Y]; Z = 3*ones(size(Xsurf)); surf(Xsurf,Ysurf,Z)
|
Pages: 1 Prev: Read from all files in a directory with a MATLAB Script Next: Simulink problem pls help. |