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

4 Ansichten (letzte 30 Tage)
yogesh jain
yogesh jain am 3 Mär. 2016
Bearbeitet: Adam am 3 Mär. 2016
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

Antworten (1)

Adam
Adam am 3 Mär. 2016
Bearbeitet: Adam am 3 Mär. 2016
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' )

Kategorien

Mehr zu Specifying Target for Graphics Output finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by