Hi,
I have a program which works great but the axis are still rescaling even with the :
xlim manual;
xlim([700 1000]);
I don't know how to force it to be fixed. There is the all code attached, maybe it is because of the loop.

 채택된 답변

Image Analyst
Image Analyst 2016년 8월 25일

1 개 추천

I don't know what all the functions like SetLine, SetMarker, etc. do. Maybe some of them call axis or xlim() -- I don't know. What you need to do is to set a breakpoint on the xlim([700 1000]); line and see if that sets up the x axis like that. It should, though perhaps you might have to plot some data first. If it does set up the axis correctly, then step through the rest of the code one line at a time until you find the one that changes the x axis and make sure it doesn't do that anymore.

댓글 수: 3

Oldemonium
Oldemonium 2016년 8월 26일
편집: Oldemonium 2016년 8월 26일
The other functions are just plot3 and some set to actualize my figure, nothing more. I tried to set some breakpoint and the axis limit goes wrong after a few SetMarkers. Here is the SetMarkers.m but I don't think that there is anything that could disturb it.
function [a] = SetMarkers(m1)
global loopbegin;
a=plot3(m1(loopbegin,1),m1(loopbegin,2),m1(loopbegin,3));
end
EDIT : Actually, when I go through the first SetMarkers, it goes crazy. It is just centering around my first marker (coming from a 3D motion capture)
I think the axis may be adjusting after you plot additional points. Try saying
hold on;
after you call xlim() and see if that makes it retain its settings even after you plot more stuff with points that would lie outside the 700-1000 range.
Oldemonium
Oldemonium 2016년 8월 26일
Problem solved, I just put the axis setting after all the first plot3 declaration and it works ! You were right, the plot function kind of reset all the axis.
Thank you very much Image Analyst.

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

질문:

2016년 8월 25일

댓글:

2016년 8월 26일

Community Treasure Hunt

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

Start Hunting!

Translated by