How to export non-blurry eps images?

后端 未结 10 1852
攒了一身酷
攒了一身酷 2020-12-15 07:08

I\'m exporting an image in Matlab using the eps format, but it smooths the image. Matlab does not blur the image using other formats such as png. I would like to know how to

10条回答
  •  感动是毒
    2020-12-15 07:48

    I just wrote this simple drop-in replacement for imagesc. It doesn't support all but the most basic features, but I still hope it helps.

    function h = imagesc4pdf(C)
    
    [ny nx] = size(C);
    
    px = bsxfun(@plus, [-0.5; 0.5; 0.5; -0.5], reshape(1:nx, [1 1 nx]));
    py = bsxfun(@plus, [-0.5; -0.5; 0.5; 0.5], 1:ny);
    
    n = numel(C);
    px = reshape(repmat(px, [1 ny 1]), 4, n);
    py = reshape(repmat(py, [1 1 nx]), 4, n);
    
    h = patch(px, py, reshape(C,1,n), 'linestyle', 'none');
    
    xlim([.5 nx+.5]);
    ylim([.5 ny+.5]);
    set(gca, 'ydir', 'reverse');
    

提交回复
热议问题