필터 지우기
필터 지우기

Plot a point with respect to second axis in an existing plotyy

조회 수: 2 (최근 30일)
j_solar
j_solar 2014년 2월 4일
답변: j_solar 2014년 2월 5일
I have a figure with two curves plotted with plotyy and I want to plot a point over the curve referenced to the second axis but I just can't figure it out. I can easily do it for the curve of the primary axis. Here is my code:
[AX, H1, H2] = plotyy(curva_generador(:,1), curva_generador(:,2), curva_generador(:,1), p_generador(:));
axes(AX(2))
h=plot(Vm(5), Pm(5), 'r.-');
%Vm is the x axis values for both plots and Pm is the y axis values %for the plot in the secondary axis
This just plots something weird

채택된 답변

j_solar
j_solar 2014년 2월 5일
Ok, so I figured it out:
after plotyy this is the following code:
hold(AX(2), 'on'); plot(AX(2),Vm(5), Pm(5), 'r.-');
This will plot the point with respect to the second axis

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Two y-axis에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by