You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When exporting a 2D plot (contourf plot for example) in vector form (PDF) or as a bitmap(PNG), demcmap is completely ignored and export reverts to "parula". This does not happen with other inbuilt colormaps ("hot" for example). Issue present in R2024a release with export_fig v3.44
MWE below.
Z =peaks;
F=figure();
ax=axes(F);
contourf(ax,Z);
%colormap(ax,"hot");
demcmap(Z,10);
cb=contourcbar;
export_fig(F,'test','-png','-pdf');
The text was updated successfully, but these errors were encountered:
Getting back to this issue after a long time.
I am still not sure how demcmap() modifies the figure exactly in the above example, but I have a workaround which works.
[CMAP, CLIM] = DEMCMAP(...) option allows use of colormap() which behaves nicely with export_fig().
Modified MWE
Z =peaks;
F=figure();
ax=axes(F);
contourf(ax,Z);
C=demcmap(Z,10); % use the colormap returned by demcmap() function
colormap(ax,C);
cb=contourcbar;
export_fig(F,'test','-png','-pdf');
@altmany maybe this issue can be closed if this workaround satisfactory. Looks like a niche scenario in any case.
When exporting a 2D plot (contourf plot for example) in vector form (PDF) or as a bitmap(PNG), demcmap is completely ignored and export reverts to "parula". This does not happen with other inbuilt colormaps ("hot" for example). Issue present in R2024a release with export_fig v3.44
MWE below.
The text was updated successfully, but these errors were encountered: