필터 지우기
필터 지우기

Creating vector plots of wireframe surfaces

조회 수: 13 (최근 30일)
Theo
Theo 2014년 9월 6일
답변: Theo 2014년 9월 7일
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?

채택된 답변

Theo
Theo 2014년 9월 7일
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.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by