有一些关于
this closely related question的好建议,虽然他们处理比你更复杂的情况.如果你想要一个超简单的DIY解决方案,你可以试试这个:
plot(rand(1,10)); %# Plot some random data
ylabel(gca,'scale 1'); %# Add a label to the left y axis
set(gca,'Box','off'); %# Turn off the box surrounding the whole axes
axesPosition = get(gca,'Position'); %# Get the current axes position
hNewAxes = axes('Position',axesPosition,... %# Place a new axes on top...
'Color','none',... %# ... with no background color
'YLim',[0 10],... %# ... and a different scale
'YAxisLocation','right',... %# ... located on the right
'XTick',[],... %# ... with no x tick marks
'Box','off'); %# ... and no surrounding box
ylabel(hNewAxes,'scale 2'); %# Add a label to the right y axis
这就是你应该得到的: