reset GUI axes properties, including position etc

2 ビュー (過去 30 日間)
carmen
carmen 2012 年 3 月 13 日
Hello,
I have an axes object within a GUI that is subsequently used for different images/plots.
How can i reset all properies of the axes object befor using it again?
i tried the cla and reset command, but it does not restore the original size (important when turning colorbars on and off) nor do the caxis values get reset. I could hardcode these things, but isthere a convenient way?
i thought about copying the axes handle during startup of the gui and paste it later, but i did not succeed:
%...
function gui_OpeningFcn(hObject,eventdata,handles,varargin)
handles.output=hObject;
a=get(handles.myaxes);
handles.myaxesbackup=a;
guidata(hObject);
function pushbutton1_Callback(hObject,eventdata,handles)
% do something with the axes, e.g. plot
function pushbutton2_Callback(hObject,eventdata,handles)
set(handles.myaxes)=handles.myaxesbackup; % <== POINT OF THIS QUESTION
% do something ele with my axes
anybody can help me out? The problem i try to solve is that the appearence of plots on the axes depend on what was done before with the plot. for example, using colorbar decreases the size of the x-axis, and colormaps are taken from the previous plot. thanks.
  1 件のコメント
carmen
carmen 2012 年 3 月 13 日
i guess a workaround is to use
h=figure;
% some figure code
close(h)
this fixes my froblem technically, however, he plot is not anymore embedded into the gui

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeGraphics Object Programming についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by