Figures saving in partial gray-scale

14 ビュー (過去 30 日間)
Kate
Kate 2013 年 1 月 24 日
I am using the following command to create an animated gif
imwrite(im,map,'TestMovie.gif','DelayTime',0,'LoopCount',1)
Although the graphic looks correct on the screen within Matlab, when I open the test movie, some (not all) of the colors turned to gray. The animated gif only shows red, yellow, blue and gray.
I have also had this problem happen before when using the print -depsc2 command with contoured figures. Although the plot itself looks correct, the colorbar is incorrect and only shows red, blue, yellow, and gray.
Does anyone know what the problem is and how to fix it?
Any help would be appreciated.
Thanks
  2 件のコメント
Walter Roberson
Walter Roberson 2013 年 1 月 24 日
What are you passing in for "map" ?
Kate
Kate 2013 年 1 月 25 日
I get the variable "map" from the following lines:
set(gca,'nextplot','replacechildren','visible','on') f = getframe(gcf); [im,map] = rgb2ind(f.cdata,256,'nodither');
It looks like it's saving map as a 12x3 matrix, even though my colormap is a much larger matrix (around 100x3).

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeColor and Styling についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by