I plot a single trace in MATLAB with plot()
. I\'d like to add a right-y axis with a different set of tick marks (scaled linearly). Is this possible?
Jiro's solution is good (file Exchange function), however, it does not allow to use Matlab's built-in plot functions (bar, scatter, etc.), and you have to use plot2axes instead. Matlab's own help gives the solution to have two axes on any type of plots: ax2 = axes('Position',get(ax1,'Position'),... 'XAxisLocation','top',... 'YAxisLocation','right',... 'Color','none',... 'XColor','k','YColor','k');
Look at: http://www.mathworks.com/help/techdoc/creating_plots/f1-11215.html