MATLAB Answers


How to prevent small lines from disappearing on zoom out?

Asked by Chuck37
on 16 Jan 2019
Latest activity Commented on by Walter Roberson
on 17 Jan 2019
I have a 2D curve that I am plotting as very small segments so I can change the color per segment. I have found that if I zoom out, the entire thing just disappears, perhaps due to some graphics optimization that considers each segment to be excessively small? Is there a way around this?
EDIT: For example:
for ii=0:1000
plot([0 0],[ii*0.01 ii*0.01+0.01],'linewidth',3)
hold on
axis([-100 100 -100 100])
At this point I have a blank plot.


Graphical representation would be useful.
See code above. Not worth posting a blank axis.
Possibly just being subsampled away when it displays on your screen in much fewer number of pixels?

Sign in to comment.





1 Answer

Answer by madhan ravi
on 17 Jan 2019

Becuase you plot single points in every iteration and you haven‘t mentioned a marker for it
% remove axis(...)


It's not single points, it's very short lines. The reason I'm doing it (not shown in example above) is to color each segment a custom color. If I switch to points, they lay on top of each other annoyingly. I started there and went to this solution instead. Of course, this is failing for a different reason.
Look in the File Exchange for the colored line contribution based on surf or the one based on patch.

Sign in to comment.