Borrar filtros
Borrar filtros

plotyy with extra markers

3 visualizaciones (últimos 30 días)
Sven Schoeberichts
Sven Schoeberichts el 2 de Nov. de 2011
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..

Respuesta aceptada

Jan
Jan el 2 de Nov. de 2011
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.

Más respuestas (0)

Categorías

Más información sobre Two y-axis en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by