Force the axis no to rescale

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.

 Accepted Answer

Image Analyst
Image Analyst on 25 Aug 2016
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 Comments

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.
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.

Sign in to comment.

More Answers (0)

Categories

Community Treasure Hunt

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

Start Hunting!