Multiple plots using same axis in Matlab
2 次查看(过去 30 天)
显示 更早的评论
I have a pop-up menu (used GUIDE to create it.) which calls 3 functions
- first function gives out a scatter plot of 14x14x14
- second function plots a bar graph of 4x1 (dynamic data)
- third function plots an Mx14 (dynamic data)
the thing all these use the same axes
axes(handles.someName).
I tried putting axes focus on every switch statement
function plot_options_popup_Callback(hObject, eventdata, handles)
str = get(hObject, 'String');
val = get(hObject, 'Value');
switch str{val};
case 'Final Reading'
YesNo = evalin('base','exist(''eeg_output_1d'',''var'')');
axes(handles.eeg_final)
if(YesNo == 1)
plot(evalin('base','eeg_output_1d'));
else
return;
end
case 'Activation Plot'
axes(handles.eeg_final)
activation
case 'Emotion State'
axes(handles.eeg_final)
emo_Callback
end
And when I change the option to a new one, the focus changes to the dynamic data which is continuously plotting.
Is there any way I could ask to GUI to stick to the thing what I want to and plot the dynamic data in the background?
Thanks in advance.
0 个评论
回答(1 个)
per isakson
2015-2-2
编辑:per isakson
2015-2-2
Yes, provide the axes-handle in the call to scatter3 ... instead of setting the current axes. Doc says:
scatter3(ax,___) plots into the axes specified by ax instead of into the
current axes (gca). The ax option can precede any of the input argument
combinations in the previous syntaxes.
and
plot(ax,___) plots into the axes specified by ax instead of into
the current axes (gca). The option, ax can precede any of the input
combinations in the previous syntaxes.
and
bar(ax,___) plots into the axes specified by ax instead of into the
current axes (gca). The option ax can precede any of the input
argument combinations in the previous syntaxes.
2 个评论
per isakson
2015-2-2
编辑:per isakson
2015-2-2
Not sure I understand or rather I don't understand. Axes-handles are unique in a Matlab session. Make an experiment!
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Interactive Control and Callbacks 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!