views:

48

answers:

2

This is related to http://stackoverflow.com/questions/3181290/matlab-how-to-avoid-jagged-image

I want to plot the symbol "+" which represent the x,y coordinate. I used jpg as background while ploting. The color of the "+" is blue and plotted on the same image. There were many x,y coordinate which I read through LOOP.

My problem is that when I save the image with the "+" plotted on it, the color of the "+" is not blue but black and with some 'noise' around it.

How to save the image with the "+" and maintain the color?

+2  A: 

It's probably because you're saving it as a JPEG and the compression artifacts have messed up your image. I would recommend saving it as an EPS file, but perhaps you should try BMP since it's easy to use with Microsoft Word, etc. which might be better for you.

Jacob
+1  A: 

It is definitely JPEG-repated problem. Zoom in to your '+' symbol and you will see a lot of artifacts around it. JPEG format is good for photos, but not for graphics with many areas of the same color. You need lossless format like BMP, TIFF (with lossless compression), PNG, GIF, etc. I would recommend PNG format, which is small and supported in many applications and platforms.

print -dpng filename
yuk