MATLAB: Overlaying Plots on Bar Graphs

barplots

I want to creat an overlaying a dot plot on a bar graph. It seems very simple but I am running into 2 problems (1) I can't get ride of tick markers on both right and left side. I want the right on the right and left on left (2) How can I label the bar with text (say ON, QC, BC) and the dot with values
My data and code
hmM = [0.8 0.6 0.2];
hm = [0.25 0.38 0.60];
figure (1)
bar(hmM, 'y')
h1 = gca;
h2 = axes('Position',get(h1,'Position'));
plot(hm,'*')
set(h2,'YAxisLocation','right', 'Color','none')
set(h2,'XLim',get(h1,'XLim'),'Layer','top')

Best Answer

With regards to the ticks: what you should probably use is plotyy()
To label a dot with a value, you will need to text() the label at the appropriate position.
Related Question