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

2 ビュー (過去 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 Center および File ExchangeGraphics Object Properties についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by