I have a 3-D plot with large number of data points (100,000+) that I need to export to eps into Latex for publication. I have tried numerous options but none of them are satisfactory.
First the data points are randomly generated inside a non-rectangular domain (the domain is a triangle in R^2). I tried interpolating into a rectangular grid but the edge artifacts are not desirable. So I resorted to generate a large number of points to sufficiently show the features of the surface (objective function).
The default `print -depsc2` in matlab2015a is taking too long to render the output. I looked into epscombine and figure2eps. Epscombine is outdated as it looks for a tag in the eps file that is not used in recent matlab. Figure2eps relies on epscombine under the hood but it fails to detect any surfaces or patches as my figure only contain lines.
Is there an option in print I can use to perform mixed mode export (i.e. vectorize text/axis and rasterize the rest)?
Here is the relevant part of the code, where the z direction is color coded based on the function value.
sr_min = min(sum_rate);
sr_max = max(sum_rate);
diff_sr = sr_max-sr_min;
n_colors = size(cmap,1);
lvls = sr_min:diff_sr/64:sr_max;
figure;
for cc = 1:n_colors,
ii = find( sum_rate <= lvls(cc+1) & sum_rate >= lvls(cc));
h{cc} = plot3(px(ii),py(ii),sum_rate(ii),'.','Color',cmap(cc,:)); hold on;
end
Update (4/7/2016): Using Matlab 2015a, I can hide the axes/text and grid lines, print the data using -opengl, and do the reverse (hide data, make axes/text and grid lines visible) and print using -painters (see code below). When I manually merge the eps files, depending on which order I put the components in, one always overwrite the other completely. So this hack is not working, a more sophisticated way is needed.
ax = gca;
ax.Title.Visible='off';
ax.XColor = 'none';
ax.YColor = 'none';
ax.ZColor = 'none';
print -depsc2 -opengl data.eps
set(gca,'color','none')
set(gcf,'color','none')
for cc = 1:n_colors,
set(h{cc},'visible','off')
end
grid off
ax.XColor = 'k';
ax.YColor = 'k';
ax.ZColor = 'k';
ax.Title.Visible='on';
print -depsc2 -painters axes.eps
disp('eps generated');
Regards, David
2 Comments
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/277570-force-print-to-vectorize-axes-text-and-rasterize-the-rest#comment_977244
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/277570-force-print-to-vectorize-axes-text-and-rasterize-the-rest#comment_977244
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/277570-force-print-to-vectorize-axes-text-and-rasterize-the-rest#comment_977478
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/277570-force-print-to-vectorize-axes-text-and-rasterize-the-rest#comment_977478
Sign in to comment.