MATLAB: Line Plot with Markers possible

animated lineplot

Hello,
I am plotting a dataset and, as you can see, when a hysteresis is closed he gets back to a certain point. That's what the code does and that is good so far but in the plot he jumps to that certain point and plots a line:
When the plotting is done with a marker the line won't appear.
I'd prefer to use a line plot. Is there a trick to avoid "jumping-lines" in a line plot or maybe use lines in a marker-plot?
my code:
hp=plot(0,0, 'o'); %initial plot
for i=1: ...
%calculating stress - strain relation, then
set(hp,'xdata',Eps(1:i),'ydata',Sig(1:i))
pause(0.1)
drawnow
end
Regards

Best Answer

To avoid "line jumping" you need to insert a NaN or Inf into the data at the place you want the break to appear.
You can get a line plot by changing
hp=plot(0,0, 'o'); %initial plot

to something like
hp=plot(0,0, '-'); %initial plot