フィルターのクリア

uiaxes title disappears when using plot(ax, ...) after cla(ax,'reset')

4 ビュー (過去 30 日間)
Paul
Paul 2022 年 12 月 23 日
コメント済み: Paul 2022 年 12 月 23 日
My function makePlot(px) is called from the main script with makePlot(ax) where ax is a uiaxes created before calling makePlot. makePlot has two plot commands, sets a title and a few other bits and bobs. Everything is then displayed as expected in my uigridlayout.
I also have a function valueChange which adjusts various parameters before calling makePlot to redisplay the new plot. Before calling makePlot from this function I issue cla(ax,'reset'). At this point the new plot is dispalyed, reflecting the changed parameters, but without a title (the title is set in makePlot).
When the attached script is run for the first time, the title is displayed correctly. If you then change one of the acids in the dropdowns, the plot is redisplayed but without a title.

採用された回答

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2022 年 12 月 23 日
Here is your corrected code that contains two lines are repeated for once more on lines 263 and 264:
px.Title.String = "Titration of 0.1M weak acids with 0.1M sodium hydroxide";
px.TitleFontWeight = "normal";
  1 件のコメント
Paul
Paul 2022 年 12 月 23 日
Thank you for that. In fact, the two lines do not need to be repeated, they just needed to be moved down to the new location at lines 263 and 264. It didn't really make sense that the same two lines would need to be repeated.
Thanks again.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by