I have plotted two curves using plotyy function of MATLAB:
[AX,H1,H2] = plotyy(voltage_span, amplitude,voltage_span, Ca_SR);
The problem is
set(AX(1), 'YColor', [0 1 0])
set(AX(2), 'YColor', [1 0 1])
To change the font size of the right axis, enter the following code:
set(AX(2),'YColor', [1 0 0]); % Change the right Axis's color to red
set(AX(2),'FontSize', 20); % Change the right Axis's font size to 20
"YColor" property is the color of the right axis. Ax(2) holds the handle to the right axis(and Ax(1) to the left axis).
You might ask why the following does not work:
set(get(AX(2),'YColor'),[1 0 1]);
The reason is that "YColor" is not a handle and
get(AX(2),'YColor')
simply returns the color of the right axis (which is light green by default):
>> get(AX(2), 'YColor')
ans =
0 0.5000 0
However, for changing the left axis' label, you should write this:
set(get(AX(2),'Ylabel'),'String','Fast Decay')
Because 'Ylabel' property actually contains a handle to the label object.
By the way, to remove the XTicks of the right axis, do this:
set(AX(2),'XTick', []);