Hi all,
I am having some trouble clearing an axes using the reset command below:
cla reset
I have created an axes with a secondary axis through the following command (the variables F, S, L and D are arrays):
set(get(handles.ax1, 'Parent'), 'HandleVisibility', 'on'); %set handle visibility to on
axes(handles.ax1); %make ax1 the current axis
x1 = F;y1 = S;y2 = L;y3 = D;hl1 = line(x1,y1,'Color','r'); %plot a line in the current axis
hl2 = line(x1,y2,'Color','g');handles.ax2 = axes('Units', 'character'); %create a new axis and set units to be character
set(handles.ax2, 'Position',get(handles.ax1,'Position'),... 'YAxisLocation','right',... 'Color','none',... 'YColor','k'); %position the new axis on the earlier existing axis
hl3 = line(x1,y3,'Color','b','Parent',handles.ax2); %plot a line on the new axis
However, when I use the "cla reset" command, it does not reset the secondary axis I created, nor the data from the secondary axis.
How can I fix this?
Best Answer