How to permanently hide the toolbar for an axes even after replotting

9 ビュー (過去 30 日間)
Jim Hokanson
Jim Hokanson 2024 年 9 月 20 日
コメント済み: Voss 2024 年 9 月 21 日
I've done a lot of searching and I can't seem to find a way to disable showing the axes toolbar. There are some options that work such as turning the toolbar visibibility off or using the axtoolbar function, but they are temporary. What's the official way of telling a specific axes to stop creating the toolbar?
  2 件のコメント
Hitesh
Hitesh 2024 年 9 月 20 日
Hi Jim Hokanson,
You can try below command:
fig = figure('Toolbar', 'none');
However, this will prevent all toolbars from being generated, including the axes toolbar.
Jim Hokanson
Jim Hokanson 2024 年 9 月 20 日
編集済み: Jim Hokanson 2024 年 9 月 20 日
Hi Hitesh,
This works, surprisingly. To me this seems like it should delete the figure's toolbar (and not impact axes). I am curious how to do this for a specific axes though (although technically this approach would be fine for me).
Thanks,
Jim

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

回答 (1 件)

Voss
Voss 2024 年 9 月 20 日

You can delete it, e.g.:

delete(gca().Toolbar)
  4 件のコメント
Jim Hokanson
Jim Hokanson 2024 年 9 月 21 日
That is a solution, but it is temporary. Is it not possible to do this permanently until the axes object is cleared?
Voss
Voss 2024 年 9 月 21 日
Use low-level graphics functions such as line, surface, and patch, rather than their high-level counterparts such as plot, surf, and fill. Low-level functions won't cause the axes toolbar to reappear.

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

カテゴリ

Help Center および File ExchangeData Exploration についてさらに検索

製品


リリース

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by