Creating vector plots of wireframe surfaces

18 vues (au cours des 30 derniers jours)
Theo
Theo le 6 Sep 2014
Réponse apportée : Theo le 7 Sep 2014
The situation is that you'd like to plot a surface mesh using many points, but only wish to display the mesh lines within an undersampled grid. This can be done with the wireframe fix by Daniel Ennis.
The following plots a surface using 101x101 points, sets the edges to none and faces to white, and then plots a wireframe with 5 times fewer lines.
x = [0:0.1:10];
y = [0:0.1:10];
z = sin(x)'*cos(y);
S = mesh(x,y,z); wireframe(x,y,z,5);
set(S, 'EdgeColor', 'none', 'FaceColor', 'w');
set(gca, 'Visible', 'off')
This works if you want to output the image to a raster format, but if you want to output to a vector format, then it looks terrible. These were outputted using the export_fig package on the File Exchange, but all exporting formats will be similar.
I've tried all three types of renderers, and they all look similar.
There are similar problems if you use 'interp' option for the FaceColor, but this is not so big of a deal since if you're looking for a smoothly interpolated colored surface, you're going to have to do it rasterized anyways.
Is there a way to generate black-and-white mesh surfaces using many points, but with downsampled edges?

Réponse acceptée

Theo
Theo le 7 Sep 2014
Daniel Ennis, the creator of the wireframe package for Matlab, has indicated that this is related to a fundamental problem with Matlab's inability to generate the EPS file. This seems to be a well known problem that has been discussed many times on the board (though in different forms).
I may have to turn to something like matplotlib to generate the pictures, in that case. If anybody has any further suggestions, please do let me know.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by