Contourf lines showing up on PDF
Show older comments
I created some contourf plots, set the LevelStep to 1, and removed the lines using LineStyle='none'. I can copy and paste the figure into PowerPoint and they look great, exactly like I want. But then, when I save the PowerPoint file as a PDF, white lines will appear that look like the contour lines. Is there any way to get it so that they will not show up in the PDF. Attached is the code as well as screenshots from the PPT and the PDF (The black dots are just a scatterplot that I overlaid on the contour plots). Thanks in advance!
[M, c] = contourf(X,Y,Z,'LineStyle','none');
colormap turbo
clim(limits);
c.LevelStep = 1;
xticklabels("");
yticklabels("");
PPT:

PDF:

8 Comments
Dyuman Joshi
on 7 Dec 2023
And you can save the plot as image as well, which can be imported in the PPT.
Walter Roberson
on 7 Dec 2023
Did you happen to experiment with setting the line color to 'none' instead of the line style ?
Austin
on 7 Dec 2023
Star Strider
on 7 Dec 2023
If you want the colours only and not the lines, another option might be to use surf instead, with 'FaceColor','interp', 'EdgeColor','interp' and ‘view(0,90)’.
Dyuman Joshi
on 8 Dec 2023
@Austin, Is saving the plot directly as pdf an option?
As that generates a high quality image.
Georg
on 12 Jun 2025
First plotting with a lower number of colors works.
contourf(X, Y, Z, 100 , 'LineColor', 'none');
hold on;
contourf(X, Y, Z, 255 , 'LineColor', 'none');
My guess is the white lines are transparent lines between the colors, so putting another plot, where the lines are offset, hides them quite well.
Accepted Answer
More Answers (0)
Categories
Find more on MATLAB Report Generator in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!