フィルターのクリア

grid problem with uicontrol

1 回表示 (過去 30 日間)
quai20
quai20 2011 年 1 月 26 日
Hi !! I'm working on GUI figures and in one of them there's a plot. When I open another figure in my GUI (with a pushbutton for example) the plot in the first figure is covered by a grid and i can't figure out why this grid appears. I may not be clear but if anyone has an idea...or understand what I'm talking about.

回答 (1 件)

Walter Roberson
Walter Roberson 2011 年 1 月 26 日
My guess is that the code to create the second figure uses
grid on
without being careful about what the current axes is.
A lot of code relies upon a sequence such as
figure
plot(....)
grid on
which rely upon the "active figure" and the "active axes" be what the programmer expects. Unfortunately there are circumstances under which the active instance might have changed unexpectedly. It is safer to write code that always explicitly gives the handles that are being acted against:
f = figure;
ax = axes('Parent', f);
plot(ax, ....);
grid(ax,'on')
  1 件のコメント
Paulo Silva
Paulo Silva 2011 年 1 月 26 日
that's a common error for most new users of matlab :)

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

カテゴリ

Help Center および File ExchangeInteractive Control and Callbacks についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by