Can I hade the Figure toolbar without hiding the Axes toolbar?

MATLAB 2025b.
I am working on a small and simple MRI image viewer. I am creating a Figure to view the images, and adding mouse-based controls for window/level, pan, zoom, etc.
Is there a way to hide the Figure toolbar (circled in red) without losing the Axes toolbor (circled in green)? (I realize the Axes toolbar only appears when the pointer hovers over the axes.)
If I wait till the figure is created and use hF.ToolBar='none', the Figure toolbar disappears and the Axes toolbar stays. This is what I want. However, I cannot figure out how to accomplish the same thing while creating the figure. If it matters, the figure is created inside a handle class method.
Thanks in advance.

Réponses (1)

Matt J
Matt J le 20 Mar 2026 à 18:12
figure(Toolbar='none')

2 commentaires

Matthew
Matthew le 20 Mar 2026 à 21:06
Thanks for the quick answer. I did try that. If I include that in the code that run during the class instantiation, both the figure and axes toolbars are hidden or not visible. But if I wait till the instantiation is complete and use the command window to set that figure property, it does indeed hide the figure toolbar and leaves the axes toolbar intact. And I cannot determine why these two approaches give different results.
app.hF = figure( ...
Colormap = gray(256), ...
Position = [400,100,640,480], ...
Name = 'VI Data', ...
WindowStyle = 'normal', ...
MenuBar = 'figure', ...
ToolBar = 'none', ...
WindowButtonUpFcn = @app.MouseRelease );
Matt J
Matt J le 20 Mar 2026 à 22:13
Modifié(e) : Matt J le 20 Mar 2026 à 22:18
The axes toolbar is not visible because the figure has been freshly created and you haven't created any axes yet, or if you have, you have not yet hovered over the axes toolbar with the mouse. That will always be true, unfortunately. There is no way to instantiate an axes with its toolbar visible from the get-go, nor to keep it permanently visible after moving the mouse out of the axes boundaries.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Graphics Object Properties dans Centre d'aide et File Exchange

Question posée :

le 20 Mar 2026

Modifié(e) :

le 20 Mar 2026 à 22:18

Community Treasure Hunt

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

Start Hunting!

Translated by