Painters renderer creates unwanted white lines

4 ビュー (過去 30 日間)
John Mahoney
John Mahoney 2012 年 12 月 31 日
コメント済み: Arthur 2023 年 12 月 19 日
I want to render a surface using the painters renderer to make use of the vector graphic nature. In particular so the fonts and edges/lines will be sharp.
When rendering a surface with the painters renderer, I find that there are white lines that bisect each patch of the surface.
A minimal example.
Z = peaks(5);
s = surf(Z);
view(3)
set(gcf, 'renderer','painters')
print('-depsc2', 'peaks_with_white_lines')
Other discussions of this issue suggest using a different renderer. This seems unacceptable because of the font rendering alone.
Oliver says that it is really an issue with the image viewer, not the image. https://sites.google.com/site/oliverwoodford/software/export_fig I have not been able to find a viewer that does not display these white lines.
Any suggestions for either viewing the images without these artifacts or not creating them in the first place?
John
  2 件のコメント
Alejandro
Alejandro 2022 年 1 月 3 日
9 years after and the problem of white lines is still there...
Adam Danz
Adam Danz 2022 年 1 月 3 日
@Alejandro, how are you exporting the image?
Have you tried any of the more recent tools such as exportgraphics?

サインインしてコメントする。

回答 (2 件)

Ondra Kamenik
Ondra Kamenik 2016 年 4 月 19 日
I have the same problem.

Sanders A.
Sanders A. 2022 年 4 月 15 日
What I ended up doing was exporting the figure twice: once with openGL and then again with painters and then overlating the surface from openGL onto the editable axes from painters in Illustrator (or vice versa). That being said, I removed all the axes and other labels from the openGL version as those couldn't be editted and I also used "cla" on the painters version to remove the surface I wanted (I had to make sure the axes and labels remained correct) as it was a nuisance to remove in Illustrator as each of the white lines on teh sruface denoted a different surface that had to be selected and deleted...
Hopefully someone may find this useful or be able to suggest a better alterantive.
  4 件のコメント
Adam Danz
Adam Danz 2022 年 4 月 20 日
For MATLAB R2020a and later, I urge you to check out exportgraphics.
Arthur
Arthur 2023 年 12 月 19 日
@Adam Danz exportgraphics works great! But the next line of code also produces white lines, when I try to insert .eps files into LaTeX by \includegraphics.
exportgraphics(gcf,'test.eps','BackgroundColor','none','ContentType','vector')

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeLighting, Transparency, and Shading についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by