MATLAB Answers

Make UIAxes Background invisible or hide it in APP Designer

12 views (last 30 days)
Khalala Mamouri
Khalala Mamouri on 21 Sep 2020
Answered: Benjamin Kraus on 11 Nov 2020 at 22:20
Hi,
I want to hide completely a uiaxes in my app. I first hided the Axes (easy)
app.UIAxes.Visible = 'off';
But still the background is present, i used a second command to change background color to "none". But it throws an error. ANy solutions please ?
set(app.UIAxes,'BackgroundColor','none')
Error in V_1_APP/PassiveElementsButtonPushed (line 1573)
set(app.UIAxes,'BackgroundColor','none')
Error using matlab.ui.control.internal.controller.ComponentController/executeUserCallback (line 382)
Error while evaluating Button PrivateButtonPushedFcn.

  0 Comments

Sign in to comment.

Accepted Answer

Ameer Hamza
Ameer Hamza on 21 Sep 2020
It seems that the background color of a UIAxes cannot be set to 'none'. See the attached app for an alternative. It set the background color to the color of the figure window.

  0 Comments

Sign in to comment.

More Answers (1)

Benjamin Kraus
Benjamin Kraus on 11 Nov 2020 at 22:20
This behavior of uiaxes has changed in MATLAB R2020b.
If you check the release notes for R2020b:
BackgroundColor property of UIAxes has no effect
Setting the BackgroundColor property on a UIAxes object no longer has any effect. The area around the plot box is transparent regardless of the value of the BackgroundColor property.

  0 Comments

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!