I can't manage to save my image with white background. I generated the image by using isocaps and isosurface. I used also contours and patch.
I tried the following: set(gcf,'invertHardcopy','off') print -djpeg thefilename.jpg print -dbmp thefilename.jpg
I also tried: [X,map]=getframe; >> imwrite(X,map,'thefilename.jpg')
Then I tried: saveas(gcf,'thefilename.png')
In all the cases I always get black background. Could somebody give a hint? Thanks in advance Isabella please find enclosed the image. I am using Matlab R2011b 32 bit 7.13.564

 채택된 답변

Image Analyst
Image Analyst 2014년 4월 9일

0 개 추천

댓글 수: 4

Isabella
Isabella 2014년 4월 9일
Dear Image Analyst, thank you for your answer. I used export_fig, and the background is now white, but the surfaces lost their transparency. Please find enclosed the pdf file with the resulting image. Do you know how I can improve the result? Thank you for your time, Isabella
Image Analyst
Image Analyst 2014년 4월 9일
Contact Oliver - he wrote export_fig. He may say change rendering method and try again.
Isabella
Isabella 2014년 4월 9일
편집: Isabella 2014년 4월 9일
Dear Image Analyst, I solved my problem by using export_fig, but I first had to force matlab to a white background. to do this, I went to :
matlab main menu->file--> figure copy template--> Copy options
I checked Force white background.
After that, I generated the image as: export_fig('tmp.png','-png') and it worked now very well Thank you so much for the hint! I will accept your answer
Isabella
Image Analyst
Image Analyst 2014년 4월 9일
Glad you figured it out - looks tricky. Sometimes even when using export_fig, it can be tricky, but it's almost always better than attempting to use the standard functions on your own.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Kurt R Petvipusit
Kurt R Petvipusit 2014년 7월 13일

1 개 추천

Hi, you can use set(gcf, 'Color', 'w') before using the export_fig command to have a white background in your figure.

카테고리

질문:

2014년 4월 9일

답변:

2014년 7월 13일

Community Treasure Hunt

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

Start Hunting!

Translated by