Matlab figures: print Vector graphic cointaining image data

1 次查看(过去 30 天)
Dear all, i need to figure out how to create vectorgraphics in a meaningfol way. for example, this snippet produces a nice vector graphic with a 50x50 image:
function VectorGraphicTest
fig=figure(1);clf;
set(fig,...
'renderer','painter')
k=50;
data =rand(k);
range=1:k;
[xx,yy]=ndgrid(range,range);
zz=zeros(size(xx));
surf(xx,yy,zz,data,'EdgeColor','none')
print('TestVecIMage.pdf','-dpdf')
open('TestVecIMage.pdf')
end
however, tfor larger images (640*1024) the 'painters' flag takes minues to print the figure, and Adobe has a hard time showing the images.
now my question is, how can i still print a decen quality vector graph that looks like
but is a vector plot (the pdf print of that last figure is a bitmap) This is for volume data vizualisation, generated with the following code:
function VectorGraphicTest
fig=figure(1);clf;
set(fig,...
'renderer','opengl')
k=1000;
data =rand(k);
range=1:k;
[xx,yy]=ndgrid(range,range);
zz=zeros(size(xx));1
surf(xx,yy,zz,data,'EdgeColor','none')
hold on
surf(xx,yy,zz+1000,data,'EdgeColor','none')
surf(xx,yy,zz+500,data,'EdgeColor','none')
print('TestVecIMage.pdf','-dpdf')
print('TestVecIMage.png','-dpng')
open('TestVecIMage.pdf')
end

采纳的回答

Jan
Jan 2018-3-6
Processing 650 thousand patch objects needs time. Creating and interpreting vector graphics with a huge number of elements stored in a PDF is expensive such that buying a faster computer is the best option to accelerate it.
There are better formats for such data. I'd expect e.g. a SVG to be faster, see e.g. https://www.mathworks.com/matlabcentral/fileexchange/7401-scalable-vector-graphics--svg--export-of-figures or print -dsvg in modern Matlab versions. But it is not clear if you do need a PDF file.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Interactive Control and Callbacks 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by