How do I plot the X and Y axes in a JPEG image?
This is related to MATLAB开发者_运维问答 - How to avoid a 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?
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.
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
精彩评论