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

조회 수: 8 (최근 30일)
yogesh jain
yogesh jain 2016년 3월 3일
편집: Adam 2016년 3월 3일
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