Octave graphic add-on, Octaviz



česky

1.4 Function vtk_plot and vtk_plot3



Function file: f = vtk_plot (x,y [fmt| prop, val])


Plots typical scatter (2D) line plot, where parameter x and y are vectors (so matrix Nx1). If y is omitted, x is plotted against its indices.

The optional formating arguments do nothing at the moment. More features are to be added with time.


Examples:
x=[1,1.5,3,4.1,4.5,6,7,7.5];
y=[3,1,8.4,5,3.1,1,5.3,1.5];
vtk_plot(x,y)




Function file: f = vtk_plot (x,y [fmt| prop, val])


Plots a 3D point cloud. The data point coordinates must be given as 3 equal length x, y, and z vectors.

Optional parameter fmt:
color of point - MarkerColor
size(radius) of point - MarkerSize
transparency - Opacity


Examples:
o=[30 62 19;8 21 10];
n=[31 21 11;18 42 14;55 46 17;56 25 13];
c=[5 49 15;30 50 16;42 42 15;43 29 19;18 28 12;32 6 8;63 36 15;59 60 20];
h=[23 5 7;32 0 16;37 5 0;73 36 16;69 60 20;54 62 28;57 66 12;6 59 16;1 44 22;0 49 6];
vtkplot3(o(:,1),o(:,2),o(:,3),'MarkerSize',8,'MarkerColor',[1 0 0]);
vtkplot3(n(:,1),n(:,2),n(:,3),'MarkerSize',10,'MarkerColor',[0 0 1]);
vtkplot3(c(:,1),c(:,2),c(:,3),'MarkerSize',10,'MarkerColor',[0 1 0]);
vtkplot3(h(:,1),h(:,2),h(:,3),'MarkerSize',5,'MarkerColor',[1 1 1]);




Examples with using transparency:
>> o=[30 62 19;8 21 10];
>> n=[31 21 11;18 42 14;55 46 17;56 25 13];
>> c=[5 49 15;30 50 16;42 42 15;43 29 19;18 28 12;32 6 8;63 36 15;59 60 20];
>> h=[23 5 7;32 0 16;37 5 0;73 36 16;69 60 20;54 62 28;57 66 12;6 59 16;1 44 22;0 49 6];
>> vtkplot3(o(:,1),o(:,2),o(:,3),'MarkerSize',8,'MarkerColor',[1 0 0]);
>> vtkplot3(n(:,1),n(:,2),n(:,3),'MarkerSize',10,'MarkerColor',[0 0 1]);
>> vtkplot3(c(:,1),c(:,2),c(:,3),'MarkerSize',10,'MarkerColor',[0 1 0,'Opacity',0.5]);
>> vtkplot3(h(:,1),h(:,2),h(:,3),'MarkerSize',5,'MarkerColor',[1 1 1],'Opacity',0.8);






<<< 1.3 Line in verge - function vtk_line3 1.5 Contour graph - vtk_contour3 >>>

© 2008 David Prokop