I donβt think there is a βcleanβ way to do this, but you can fake it by laying two axes on top of each other.
x1 = 1:1:50; y1 = 1:1:10; temp_data = rand(10,50); y2 = rand(50,1)*20; figure; contourf(x1, y1, temp_data); colormap('gray'); h_ax = gca; h_ax_line = axes('position', get(h_ax, 'position')); % Create a new axes in the same position as the first one, overlaid on top plot(x1,y2,'r-'); set(h_ax_line, 'YAxisLocation', 'right', 'xlim', get(h_ax, 'xlim'), 'color', 'none'); % Put the new axes' y labels on the right, set the x limits the same as the original axes', and make the background transparent ylabel(h_ax, 'Contour y-values'); ylabel(h_ax_line, 'Line y-values');
In fact, this βplot overlayβ is almost what plotyy internal function plotyy .
Here's an example output (I increased the font size for readability): 
Daniel Golden
source share