altmany / export_fig

A MATLAB toolbox for exporting publication quality figures
BSD 3-Clause "New" or "Revised" License
1.27k stars 365 forks source link

Colorbar titles in 2D plot exports do not work properly #382

Closed mahendraK96 closed 9 months ago

mahendraK96 commented 9 months ago

When exporting a 2D plot (contour plot for example) in vector form (PDF or EPS), the title of the color-bar is cut off by the boundary if the main plot has no title or just whitespace in the title. It works just fine with -PNG option. MWE below.

[X,Y,Z] = peaks;
F = figure;
contour(X,Y,Z,20);
cb = colorbar;
title(cb,'Tst','FontSize',18);
export_fig(F,'Tst','-pdf','-png','-transparent');
altmany commented 9 months ago

Fixed in latest commit