plotyy y axes overlap

6 Ansichten (letzte 30 Tage)
Vincent I
Vincent I am 16 Jul. 2012
Hi, I have a real time plot and when I try to plot using plotyy the axes overlap and the two plot lines are created slighty to the left if the last x value is not integer. how can i prevent x axes overlapping and have the graph lines plot the right way on the plot? thank you
set(hObject,'CurrentAxes',handles.Axes1);
hold(handles.Axes1,'on');
set(handles.Axes1,'units','normalized')
cah = get(hObject,'CurrentAxes');
[ax,hlines(1),hlines(2)]=plotyy([handles.Axes1],x,y{1},x,y{2});

Akzeptierte Antwort

Vincent I
Vincent I am 16 Jul. 2012
h = findobj(0,'type','axes','Tag','Top');
delete(h)
[ax,hlines(1),hlines(2)]=plotyy([handles.Axes1],x,y{1},x,y{2});
set(ax,'xlim',get(handles.Axes1,'xlim'))
set(ax(1),'xcolor','black')
set(ax(2),'tag','Top','xcolor','black')

Weitere Antworten (1)

Jan
Jan am 16 Jul. 2012
Perhaps you want to set the 'XLim' property manually instead of letting Matlab set it dynamically.

Kategorien

Mehr zu Two y-axis finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by