How to Remove or Account for 3 Dot Figure Settings Button?
Show older comments
How could I remove or adapt my script to account for the 3 dot figure settings button located in the upper right when creating figures? In a handful of my figures it obstructs title info. I was wondering if anyone knew of a way to remove this button (shown in attached image), maybe a setting I could change. I could go back and manually edit my script to insert lines in between titles, but in the future it would be nice to not have to think about this.
I anonomyzied and included example script, that doesn't show the specific 3 dot button, but in the Matlab desktop application it should appear (highlighted in attached image).
I tinkered with tiledlayout Padding and TileSpacing parameters and still have it obscuring titles.
rng(42)
lowerBound = 10;
upperBound = 90;
modelNames = ["Pruning", "UFF"];
predictionTypes = ["Training", "Cross-validated"];
nRows = 1200;
observedPruning = [ ...
100 * rand(700, 1); ...
5 + 10 * rand(250, 1); ...
85 + 15 * rand(250, 1)];
observedUff = [ ...
100 * rand(500, 1); ...
3 + 12 * rand(350, 1); ...
80 + 20 * rand(350, 1)];
trainingPredPruning = observedPruning + 6 * randn(nRows, 1);
cvPredPruning = observedPruning + 10 * randn(nRows, 1);
trainingPredUff = observedUff + 8 * randn(nRows, 1);
cvPredUff = observedUff + 16 * randn(nRows, 1);
trainingPredPruning = max(0, min(100, trainingPredPruning));
cvPredPruning = max(0, min(100, cvPredPruning));
trainingPredUff = max(0, min(100, trainingPredUff));
cvPredUff = max(0, min(100, cvPredUff));
figure('Color', 'w', 'Position', [100 100 1200 900]);
tiledlayout(2, 2, 'Padding', 'compact', 'TileSpacing', 'compact');
for modelIdx = 1:2
if modelIdx == 1
observedAll = observedPruning;
predictedAll = [trainingPredPruning cvPredPruning];
else
observedAll = observedUff;
predictedAll = [trainingPredUff cvPredUff];
end
keepRows = observedAll > lowerBound & observedAll < upperBound;
for predIdx = 1:2
nexttile;
observed = observedAll(keepRows);
predicted = predictedAll(keepRows, predIdx);
rmseValue = sqrt(mean((observed - predicted).^2));
ssRes = sum((observed - predicted).^2);
ssTot = sum((observed - mean(observed)).^2);
r2Value = 1 - ssRes / ssTot;
scatter(observed, predicted, 12, 'filled', ...
'MarkerFaceAlpha', 0.25, ...
'MarkerEdgeAlpha', 0.25);
hold on;
plot([0 100], [0 100], 'k-', 'LineWidth', 1.1);
xline(lowerBound, 'k:', 'LineWidth', 0.8);
xline(upperBound, 'k:', 'LineWidth', 0.8);
grid on;
axis square;
xlim([0 100]);
ylim([0 100]);
xlabel('Observed percent');
ylabel('Predicted percent');
title(sprintf('%s %s, %d-%d%% observed: R2 %.3f, RMSE %.2f, n %d', ...
modelNames(modelIdx), predictionTypes(predIdx), ...
lowerBound, upperBound, r2Value, rmseValue, numel(observed)), ...
'Interpreter', 'none');
axtoolbar(gca, {});
end
end
sgtitle(sprintf('Middle Observed Response Only (%d < observed < %d)', ...
lowerBound, upperBound), ...
'FontWeight', 'bold');
Answers (1)
Try
tiledlayout(2, 2, 'Padding', 'compact', 'TileSpacing', 'compact','Visible','off');
I'd recomend to save the handle to the tiledlayout object so can easily access its properties including the various tiles within.
hTL=tiledlayout(2, 2,'Padding','compact','TileSpacing','compact','Visible','off'); % save the handle
will not be visible, but still is there.
To do without entirely, use
hTL=tiledlayout(2, 2,'Padding','compact','TileSpacing','compact','Toolbar',[]);
See details under axtoolbar
ADDENDUM
On reflection, I agree it seems obtrusive for the toos button to occlude title information by default and that it should be placed somewhere that doesn't do that by default. I'd consequently suggest to submit this to Mathworks as an official support/enhancement request at <Product Support Page>
1 Comment
Charles Bergen
on 15 Jun 2026
Categories
Find more on Graphics Performance in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!