Need help with multiple figures!

Hello Matlab community !
I would like some help with my program. I want to make multiple figures with the same plots i have.I have read that i can do this with the ...figure()... or with the ..subplot...I tried them but i had no success.
The part (function) of the program with the plots is this :
function Finger_plot(F,i)
x1=F(5,i);
y1=F(6,i);
z1=F(7,i);
x2=F(8,i);
y2=F(9,i);
z2=F(10,i);
x3=F(11,i);
y3=F(12,i);
z3=F(13,i);
x=F(14,i);
y=F(15,i);
z=F(16,i);
line( [ x1 x2 x3 x], [ y1 y2 y3 y], [ z1 z2 z3 z],'Color','b','LineWidth',15.55)
hold on
plot3(x1,y1,z1,'or','LineWidth',15.55)
plot3(x2,y2,z2,'or','LineWidth',15.55)
plot3(x3,y3,z3,'or','LineWidth',15.55)
plot3(x,y,z,'ob','LineWidth',15.55)
axis equal
xlabel('x')
ylabel('y')
zlabel('z')
end
Thanks a lot in advance !
Nick K.

Answers (1)

Multiple figures:
figure, plot3(x1,y1,z1,'or','LineWidth',15.55)
figure, plot3(x2,y2,z2,'or','LineWidth',15.55)
figure, plot3(x3,y3,z3,'or','LineWidth',15.55)
figure, plot3(x,y,z,'ob','LineWidth',15.55)
subplots in one figure:
subplot(2,2,1); plot3(x1,y1,z1,'or','LineWidth',15.55)
subplot(2,2,2); plot3(x2,y2,z2,'or','LineWidth',15.55)
subplot(2,2,3); plot3(x3,y3,z3,'or','LineWidth',15.55)
subplot(2,2,4); plot3(x,y,z,'ob','LineWidth',15.55)
I prefer the FEX contribution, tight_subplot, to subplot
--- More ---
Try add
line( [ x1 x2 x3 x], [ y1 y2 y3 y], [ z1 z2 z3 z] ...
, 'Color','b','LineWidth',15.55)
hold on
axis equal
xlabel('x') ylabel('y') zlabel('z')
for every diagram

3 Comments

Hello and thanks for your answer !
I tried what you told me but
1) with the, figure, plot3(x1,y1,z1,'or','LineWidth',15.55) etc....
i took 21 figures.In each of them i could see one of the plot "items" , like a line ,then a 'or' etc but i don't get the full item.
2)with the , subplot(2,2,1); plot3(x1,y1,z1,'or','LineWidth',15.55)...etc
i took the single figure with 4 sketches in it. But none of them shows the full item i wanted to plot.
Any idea why that might happen ?
Thanks again
"full item" ???
I gave you a hint, not a complete solution.

Sign in to comment.

Products

Asked:

on 9 Jun 2012

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!