preserving RGB color quality from heatmap figures during exporting
古いコメントを表示
I wish to export in RGB heatmaps that were created using imagesc and pcolor for output. The MATLAB .fig outputs look beautiful using the "jet" color map. However, regardless of the format type (.svg, .eps, .png, etc.) the colors get blunted with the blues becoming more purplish and reds and oranges shifted more to the yellow spectrum. This still occurs despite setting/using the export feature in the figure menu to output in RGB. Ultimately, I wish to import the colormaps into adobe illustrator for figure making purposes. Only when I switch to CMYK in Adobe do the colors somewhat return to how it appeared in the original MATLAB figure, but the hues are much less vibrant and dulled. I didn't have this issue previously until recently updating MATLAB and cannot find any information how to bypass this issue. I'm using MATLAB 2020b and using a Mac.
How can I preserve in any graphical export type the same RGB color quality from the original heatmap figure?
Thank you for any help or suggestions.
%Code generating figure:
T = imagesc(pts, pts, conv2(N, g, 'same'));
figure, pcolor(T.CData);
shading(gca,'interp');
colormap(jet(4096));
8 件のコメント
DGM
2021 年 6 月 22 日
Can you supply a (minimal) example of pts,N,g, such as would allow us to replicate your output exactly? I don't see the problem on my end, but I don't know if that's because I'm using different inputs or because I'm using a different version/environment. A minimal working example of the problem would help reduce the number of unknowns.
DGM
2021 年 6 月 22 日
It may be the version I'm using, but in R2019b/linux, the saved images seem correct. I might try to see if I can get this to work in something newer, but I doubt I'll get access to that soon. Are they all purple in other viewers as well, or just when importing into Illustrator?
If you don't need stuff like the plot box and axes ticks/labels, a workaround might be to construct an indexed image instead of relying on the plot tools to manage the image output.
hxen
2021 年 6 月 22 日
DGM
2021 年 6 月 22 日
For what it's worth, I cropped out and rescaled the images from the screenshot. It's not perfect due to the resizing, but I figured I might be able to take a look at what sort of color transformation is happening between the images to see if there are any clues.
This is R,G, and B; the purple image versus the original. Ideally, these would all be straight lines with a slope of 1.

Same thing, only in HSV

Whatever is happening doesn't seem like a simple transformation -- at least not to me. I don't think it's being caused by the colormap being shifted or misread, but maybe I'm mistaken. I wonder if Matlab is aware of some system-level color management and incorrectly saving values adjusted for display? That's a very handwavy supposition on my part; I have no idea how that would work. It seems like an awful lot for an "adjustment" anyway.
hxen
2021 年 6 月 23 日
Image Analyst
2021 年 6 月 23 日
Can you post a screenshot of the image side by side in MATLAB and Adobe Illustrator?
hxen
2021 年 6 月 24 日
採用された回答
その他の回答 (1 件)
カテゴリ
ヘルプ センター および File Exchange で Creating, Deleting, and Querying Graphics Objects についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!