Alright, here goes….
my gui has multiple axes for plotting, I've setup 4 axes, axes1,….axes4
I have 40 analog signals with different Y axis limits, some signals are 0-1.0 others are 0-3600 plotting these on the same axes is not useful as the axes will be auto-scaled and the signal with the 0-1.0 limits will appear as a flat line losing its visual information.
I can play around with the y axis scaling, but decided to use multiple axes and the user will select a axes and plot what they need with the detail they need….
The analog signals are initially plotted with Visible OFF and the handles are saved for each plot. When the user selects a analog signal to display (from checkbox), I just turn the Visble to ON…..this works…great.
this set of code, sets the current axes to axes1, points to each column of data 1 to 40, while pointing at the column set the handle of the plot while visible OFF….works great…
axes(handles.axes1)
for k=1:1:40; hold on handles.plotbuf00(k,:) = plot(num0(:,k),'r','visible','off');
end hold off
guidata(hObject,handles);
Except the handle is always referenced to the axes of the initial plot command. That is, If I set the axes to axes 1, plot, visible OFF, …. then any attempt to reveal (Visible) this signal on axes 2(for example) is not possible.
when I need to reveal the selected waveform….I use the code…. function checkBoxCallback(hObject,eventData,checkBoxId)
value = get(hObject,'Value') handles=guidata(gcbo); if value==1 set( handles.plotbuf00(checkBoxId),'visible','on') else set( handles.plotbuf00(checkBoxId),'visible','off') end
Is this due to the nature of the plot command? is the axes where the signal is plotted stored in its handle, if so, can it be manipulated.
If needed, I can work around this by initially plotting , visible OFF the signals on all 4 axes, and saving its handle on each axes
just throwing this out there to see if any slick option with Matlab is available…..
thanks gary
Best Answer