Is there any alternate of "axes(handles.axes1)"

8 次查看(过去 30 天)
Hello all; In GUI while I am using multiple axes and using "axes(handles.axes1)" command , I feel it takes much time. For example -
axes(handles.axes1);
// functionality
axes(handles.axes2);
// functionality
axes(handles.axes3);
// functionality
then profiler shows that line consumes more time . I want to reduce taken time , is there any alternative of that ?
Thank you

回答(1 个)

Adam
Adam 2016-3-3
编辑:Adam 2016-3-3
All plot functions take an axes as either the first argument or they allow you to set 'Parent', hAxes as part of the property-value pair syntax.
I always use this nowadays instead of the syntax you showed above. It is more explicit and less prone to errors because it tells the plot instruction exactly which axes to plot on whereas the syntax you show simply sets an axes to be the current axes and then plots to the current axes. This also has the, sometimes undesirable, effect of bringing that axes into focus. I quite often want to plot something on an axes in a multi-window GUI without having the window containing that axes jump to the front.
So, e.g.
plot( hAxes, xData, yData );
is better than
axes( hAxes )
plot( xData, yData );
where hAxes is your axes handle. For imagesc or imshow:
imagesc( someImage, 'Parent', 'hAxes' )
imshow( someImage, 'Parent', 'hAxes' )

类别

Help CenterFile Exchange 中查找有关 Specifying Target for Graphics Output 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by