altmany / export_fig

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

Unexpected interaction of colorbar handle with tiledlayout in v3.42 commit #383

Closed mahendraK96 closed 11 months ago

mahendraK96 commented 11 months ago

The fix for the colorbar title works in figure environment but gives errors when used together with tiledlayout. MWE below

[X,Y,Z] = peaks;
F = figure;
T = tiledlayout(F,1,2)
ax1=nexttile(T,1);
contour(ax1,X,Y,Z,20);
cb1 = colorbar;
ax2=nexttile(T,2);
contour(ax2,X,Y,Z,10);
cb2 = colorbar;
title(cb1,'Tst','FontSize',18);
title(cb2,'Tst','FontSize',18);
export_fig(F,'Tst','-pdf','-png','-transparent');

Error Message: Error using getappdata Value must be a handle.

Error in [export_fig](matlab:matlab.internal.language.introspective.errorDocCallback('export_fig', 'Z:\Current Work\Matlab_Functions\export_fig-3.41\export_fig.m', 1095)) ([line 1095](matlab: opentoline('Z:\Current Work\Matlab_Functions\export_fig-3.41\export_fig.m',1095,0))) getappdata(hAxes,'LayoutPeers')]);

Error in [export_fig](matlab:matlab.internal.language.introspective.errorDocCallback('export_fig', 'Z:\Current Work\Matlab_Functions\export_fig-3.41\export_fig.m', 503)) ([line 503](matlab: opentoline('Z:\Current Work\Matlab_Functions\export_fig-3.41\export_fig.m',503,0))) [imageData, alpha] = export_fig(varargin{:});

Previous related Issue: #382

altmany commented 11 months ago

Fixed