Closed Stknx closed 6 months ago
I cannot reproduce - it runs ok on my system when I run your code in the Matlab console. Perhaps you try to run it in a Live Editor script? without additional information about your run-time environment I cannot assist
You can also try to add a call to drawnow
before you call export_fig, to ensure that the colormap is updated prior to export.
Thanks for this - it was because I was in Live Editor scripts (for both example and original problem). Ran as standalone script and all fine. Much appreciated.
I'm trying to export some surface plots I'm making with a custom colormap but noticed that the surfaces were being plotted with the default colormap rather than the specified colormap. Ran a few checks and this even extends to the basic swapping of colormaps to another of the defaults. E.g the following
gives colortest.png rather than colortest_desired.png (desired made by a copy and paste job)
Any thoughts? I tried playing with the renderer and no immediate luck there.