문제

I have to plot my data on two y axes sharing one x axis. This can be done using plotyy. How do I overlay two patch plots such that one patch is on each y axis? As of now, both my patches are plotted on the first y-axis. How do I specify the y-axis for patch command?

Thanks

도움이 되었습니까?

해결책

You can draw on either axis by setting the current axis property of the figure.

ax = plotyy(...);
% draw on axis 1
set(gcf, 'CurrentAxes', ax(1))
patch(x,y,c)
% draw on axis 2
set(gcf, 'CurrentAxes', ax(2))
patch(x,y,c)
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top