user7431005
user7431005

Reputation: 4537

Matlab figure print with no axes box

I'm trying to print a figure with the mapping toolbox. When I print my figure, it always shows a black axes box, although it is not visible in the Matlab figure itself.

This code reproduces the problem:

f = figure;
f.Position = [f.Position(1:2) 765 421];
ax = axesm('MapProjection','robinson',...
    'MapLatLimit',[-90 90],'MapLonLimit',[-180 180],....
    'Frame','on','Grid','on');
ax.XColor = 'w';
ax.YColor = 'w';
tightmap

print('test','-dpng','-r150')

This is my test.png file with the black axes box: test.png file

This is a screenshot from my Matlab figure: screenshot

EDIT: adding a box off removed the top and right line EDIT2: adding a ax.Visible = false; worked

Upvotes: 0

Views: 68

Answers (1)

user7431005
user7431005

Reputation: 4537

I figured it out.

Adding an ax.Visible = false; did it

Upvotes: 0

Related Questions