In ContourPlot, ContourStyle –> function can be used to color-code contour lines.For example, the number of contours is numC=20, then for each contour, the color is defined by a coloring function:
ContourStyle -> Table[{ColorData["Rainbow", (i - 1)/(numC - 1)]}, {i, numC}]
Of course, it is also necessary to set Contours –> numC.
Here are the examples, the famous peaks function from Matlab is used.
2D ContourPlot example:
Turn 2D plot into the 3D one:
Another 3D example:
1 comment:
Post a Comment