From: Mehmet Karatay on 12 May 2010 06:55 Look up the axes() command in help. Plotyy simple creates two axes using this. You can do the same manually and then you have complete control. (In case it is useful, plotyy and subplot don't mix well and in that case using axes manually seems to solve all the problems.) If you define two axes with the same position vector they will correspond exactly. Once you set YAxisLocation,'Right' for one of them, ylabel(axesName,'label') will put the label in the correct location for each axes. Look up further options under ''Axes Properties" in the Matlab help. Example code: position = [0.1 0.1 0.8 0.8]; %Define [left bottom width height] of axes in the figure window/output. figureName = figure('Units','Normalized'); % I find Normalized units easiest to deal with [0 0] is bottom left and [1 1] is top right of figure. axesLeft = axes('Parent',figureName,... 'Position',position); axesRight = axes('Parent',figureName,... 'Position',position,... 'YAxisLocation','right'); plot(xvalues,data,'Parent',axesLeftLabel); ylabel(axesLeft,'Left label here'); ylabel(axesRight,'Right label here'); Hope this helps, Mehmet
|
Pages: 1 Prev: Gaussian noise removal Next: Deconvolving an audio signal |