I want to superimpose a line on top of a spectrogram (plotted using imagesc). I am unable to do this using the “hold on” command. I also want to show a y scale for the line that I am plotting over the spectrogram. (Note: Spectrogram already shows a yscale of frequency values on the left hand side of the plot, I want yscale for the new line to show up on the right hand side)
MATLAB’s online documentation shows a way to plot to functions in a single figure with two y axes… but this doesnt seem to work with imagesc
http://www.mathworks.com/help/matlab/ref/plotyy.html
Just use
hold on… here’s an example: