I have a strange problem that the plot overlaps in the graph, but not in the image in the same axis.
I am sure I didn't leave hold on somewhere or else it will overlap in the image itself as well.
EDIT : I want to get rid of the blue overlapped lines, I only want one blue line to be present in that pic.
Here is a sample :
(NOTE : The black image is a RGB image but I didn't plot that atm, so it IS meant to be a transition from black to white on the graph. )
alt text http://img541.imageshack.us/img541/3212/parabolaaaaa.png
Some part of the code :
for K=1:23
hold on
I = fig.img.(['p' num2str(K)]);
bw=(I);
imshow(bw)
ss = bwlabel(bw);
s = regionprops(ss,'centroid');
centroids{K} = cat(1,s.Centroid);
hold(imgca,'on')
plot(imgca,centroids{K}(:,1), centroids{K}(:,2), 'r*'); hold on;
x=centroids{K}(:,1);
y=centroids{K}(:,2);
points=plot(x,y,'go',x,y,'rx');
hold on
axis on
axis fill
ccentroids = cat(1,centroids{:});
C1=ccentroids(:,1);
C2=ccentroids(:,2);
set(points,'XData',C1,'YData',C2);
.
.
.
p= polyfit(x2,y2,2)
parabola_x = linspace(-250,640,500);
parabola_polyval = polyval(p,parabola_x);
plot(parabola_x,parabola_polyval,'b-');
.
.
.
end
Any ideas?