MATLAB Answers

contourf with more colours

7 views (last 30 days)
With the function contourf I created the picture below. I would like to have more color gradations in it. I succeeded in the colorbar.
Does anyone have an idea?

  0 Comments

Sign in to comment.

Accepted Answer

Ameer Hamza
Ameer Hamza on 27 May 2020
You can specify the 4 input argument to contourf() to specify the number of levels you want.
contourf(x,y,z,50); % 50 levels will be created

  0 Comments

Sign in to comment.

More Answers (1)

Abdolkarim Mohammadi-Balani
Edited: Abdolkarim Mohammadi-Balani on 27 May 2020
This works for both contour and contourf. You can either tell MATLAB how many levels you want.
contour (X,Y,Z, levels);
If levels is a positive integer, it tells MATLAB how many levels you want. If levels is a vector, it tells MATLAB at which specific heights of Z you want levels to be drawn.

  0 Comments

Sign in to comment.