comet3Create a comet plot of the data in
zversus the data inxandy. Use thepeaksfunction to loadx,y, andzdata in matrix forms. Convert the data into vector arrays. Then, plot the data.
[xmat,ymat,zmat] = peaks(100); xvec = xmat(:); yvec = ymat(:); zvec = zmat(:); comet3(xvec,yvec,zvec) fig2plotly()
Create a comet plot and specify the comet body length by setting the scale factor input
p. The comet body is a trailing segment in a different color that follows the head before fading.Use the
peaksfunction to loadx,y, andzdata in matrix forms. Convert the data into vector arrays. Specifypas0.5so that the body length is0.5*length(y). Then, plot the data.
[xmat,ymat,zmat] = peaks(100); xvec = xmat(:); yvec = ymat(:); zvec = zmat(:); p = 0.5; comet3(xvec,yvec,zvec,p) fig2plotly()
Create two comet plots in a tiled chart layout by specifying the target axes for each plot.
Use the
peaksfunction to loadx,y, andzdata in matrix forms. Convert the data into vector arrays. Specify the body length scale factorpas0.25so that the body length is0.5*length(y).
[xmat,ymat,zmat] = peaks(50); xvec = xmat(:); yvec = ymat(:); zvec = zmat(:); p = 0.25;
Store the two
Axesobjects asax1andax2. Specify the target axes for each comet plot by including theAxesobject as the first input argument tocomet.
tiledlayout(1,2); ax1 = nexttile; ax2 = nexttile; comet3(ax1,xvec,yvec,zvec,p) comet3(ax2,yvec,xvec,zvec,p) fig2plotly()