plotyy with extra markers
4 次查看(过去 30 天)
显示 更早的评论
Hi all,
I have 2 signals, being plotted in a YY plot. Two peaks of each signal have to be marked with an star. I did this in this way:
subplot( 3,2,4 ), plotyy( freq, x1, freq, y2)
hold on
[ ~, h1, h2 ] = plotyy( freq, markers1, freq, markers2);
set( h1, 'linestyle', 'none', 'Marker', '*' );
set( h2, 'linestyle', 'none', 'Marker', '*' );
But it seems like it is not the best way to do this, I I move the graph in the plot, all markers and 1 signal moves. How can I mark the peaks in the signal itself, instead of holding the figure and plotting it on top?
Any help would be appreciated..
0 个评论
采纳的回答
Jan
2011-11-2
You can add the markers to the original 2 AXES objects created by PLOTYY:
subplot(3, 2, 4);
AxesH = plotyy(freq, x1, freq, y2);
hold('on');
line(freq, markers1, 'linestyle', 'none', 'Marker', '*', 'Parent', AxesH(1));
line(freq, markers2, 'linestyle', 'none', 'Marker', '*', 'Parent', AxesH(2));
You can use PLOT instead of LINE also.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Two y-axis 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!