MATLAB: Issues opening exported imagesc .eps figures from linux to macOS

macos linux imagesc eps file

Hi there,
I am having issues opening my exported imagesc .eps figures from MATLAB on linux (using a virtual server on xQuartz) to my local disk on macOS (version high sierra 10.13.6). I would like to edit the .eps files on Illustrator, which seems to be able to open the .eps files fine, however the .eps figures are seeming to lose information when transferred to macOS. Beforehand, the .eps files were in color, however when I opened them in preview as a pdf the colours blended together and I lost detail in the matrix:
imagesc .eps file in preview beforehand
imagesc .eps file in preview now
When I open the files in illustrator now they seem to keep the individual cells, but it's still in black in white
Does anybody know why I'm having these issues and how I can open the files in illustrator with colour?
EDIT: one more important thing to mention, I'm also exporting eps files as bar graphs and those are in colour, so the issue is specific to imagesc plots it seems…

Best Answer

Hey guys, I have solved the greyscale issue so I am posting the solution here in case anyone else has the same problem. When saving in command line, make sure to save as 'epsc' rather than just 'eps'.
Ie: saveas(gcf, 'myplot.eps','epsc');