Problem in plot window dimension

조회 수: 10 (최근 30일)
Gabriele Rossi
Gabriele Rossi 2020년 4월 18일
댓글: Ameer Hamza 2020년 4월 18일
I wrote a program to visualize a robot for 3D printing, I have problems in the visualization part. I have to visualize the robot, a series of lines and a mesh in the same plot using different functions, using this part of the program.
figure;
framesPerSecond = 200;
r = rateControl(framesPerSecond);
for i = 1:count
show(robot,qi(:,i),'PreservePlot',false);
hold on;
plot3 (wayPoints(:,1),wayPoints(:,2),wayPoints(:,3),'r','LineWidth',4);
stlPlotROBOT(v2,f2);
xlim([ -300 300]);
ylim([ -150 400]);
zlim([ -10 500 ]);
drawnow
waitfor(r);
end
When the program is started the visualization is this, with the small image in the center of the window
The image remains small, unless I try to zoom in or rotate the image using the zoom or rotate tool. When I use these the image becomes larger and remains so for all iterations.
How come I can't get the biggest view right from the first iteration and without taking action?
Thanks!

답변 (1개)

Ameer Hamza
Ameer Hamza 2020년 4월 18일
You can change the camera view angle to get the required view. Change the show() statement to
ax = show(robot,qi(:,i),'PreservePlot',false);
ax.CameraViewAngle = 4;
  댓글 수: 2
Gabriele Rossi
Gabriele Rossi 2020년 4월 18일
Very well, now the display is the correct one.
Ameer Hamza
Ameer Hamza 2020년 4월 18일
Glad to be of help.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Interactions, Camera Views, and Lighting에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by