フィルターのクリア

Save Image of an axes

3 ビュー (過去 30 日間)
david martinez
david martinez 2017 年 12 月 21 日
コメント済み: david martinez 2017 年 12 月 21 日
I am trying to save an image of an axes, but at the time of saving the color is modified, this is the code that I am occupying, it would be of great help a solution ...
formatos = {'*.jpg','JPEG (*.jpg)';'*.tif','TIFF (*.tif)';'*.epsc','EPS (*.eps)';'*.pdf','PDF (*.pdf)'};
[nomb,ruta] = uiputfile(formatos,'GUARDAR IMAGEN');
if or(and(isempty(nomb),isempty(nomb)),nomb==0)
msgbox('No indico un nombre para guardar archivo', 'Aviso','warn');
else
figura=figure(2);
set(figura,'InvertHardcopy','off','Color','black');
objeto_1 = copyobj(handles.axes1,figura);
set(objeto_1,'Units','normalized','Position',[0.05 0.1 0.90 0.80])
set(figura, 'PaperPositionMode', 'auto')
saveas(gcf,[ruta nomb])
close(figura)
end
  2 件のコメント
Walter Roberson
Walter Roberson 2017 年 12 月 21 日
If I recall correctly, export_fig from the File Exchange will do this kind of copying into a new figure for you.
david martinez
david martinez 2017 年 12 月 21 日
please could you write the code I would be very grateful

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

回答 (1 件)

Walter Roberson
Walter Roberson 2017 年 12 月 21 日
Workaround for the moment: Use freezeColors() from the File Exchange. That will convert all pseudocolor objects to RGB objects, and then you do not have any worry about colormaps not getting copied.

カテゴリ

Help Center および File ExchangeGraphics Object Programming についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by