Removing lines from contourf graphs

10,688

Solution 1

You can remove the black lines by setting the 'LineColor' property to 'none', either in the initial call to CONTOURF:

contourf(peaks(20),10,'LineColor','none');

Or by modifying the handle graphics object after creating it:

[C,h] = contourf(peaks(20),10);
set(h,'LineColor','none');

Solution 2

Whatever you can do with manual editing you can also do programmatically. For contourf, you can do the following:

[~,h] = contourf(peaks(20),10);
set(h,'LineColor','none')

See here for all the properties you can modify using the set command.

Solution 3

'shading flat' will do the job.
Share:
10,688

Related videos on Youtube

Crowley
Author by

Crowley

Updated on May 31, 2022

Comments

  • Crowley
    Crowley almost 2 years

    Hi all I'm using scripts for generating plots easily and with exactly the same layout.

    That's why I'd like to create contourf graph of given data automaticcaly without black contour lines. I can do it manually by advanced figure layout, byt is there a command for it?

    Thanks for suggestions; I have no idea how to solve it.