I use plotyy to plot two y1 and one y2(on the right).
I use:
[AX,H1,H2] = plotyy(x,[y1,y2],x,y3);
legend([H1;H2],'y1',y2',y3');
set(AX,'xlim',[min(x) max(x)])
set([H1;H2],'Color','k','marker','o')
Then three lines will be all in marker o.
Can I have distinct markers please?
thank you in advance.
Mike
Markers = '.ox+*sdv^<>ph';
noMarkers = length(Markers);
H1c = findobj(H1,'Type','line');
H2c = findobj(H2,'Type','line');
linehandles = [H1c;H2c];
for K = 1:length(linehandles)
set(linehandles(K),'Marker',Markers(1+mod(K-1,noMarkers)));
end
This code will cycle through the line markers in the order
given in Markers. The code is specifically designed to take into
account the possibility that [y1,y2] or y3 might be multidimensional
and so might create multiple lines on the plot: as you wanted distinct
markers, distinct markers are used for each of the resulting lines
[as far as possible considering there are only a limited number of
markers available]. The code could be simplified quite a bit if
there were a guarantee that [y1,y2] was going to result in exactly
two lines and that y3 was going to result in exactly one line.
--
"Do not on any account attempt to write on both sides of
the paper at once." -- Walter C. Sellar
Mike