Contents Previous Next Subchapters Current Chapters-> gplot gplotstyle gplotlevels glevel ginit gstyle gprint gcopy gsave gcolor gaddwin gaddwin1 gaddwin2 gaddwin3 gaddwin4 gwin glistwin gaddview setview gview gview2 glistview ginitview gdelview gaddborder gdelborder gborder gupdate Parent Chapters-> Omatrix6 graphics basicGraphics glevel Search Tools-> contents reference index search

Setting Z Values Corresponding To Color Changes In Plots
 Syntax ```glevel glevel(```levels`)` See Also gplot , and mesh or surface

Description
If levels is present, sets the values of `z` at which curves plotted with the "levels" version of gplot , mesh or surface change color, where levels is an integer, real, or double-precision column vector that is strictly monotone increasing . The first color in the current color sequence is used where `z` is less than or equal to the first element of levels, the second color is used where `z` is between the first and second elements, and so on. If there are more levels than there are colors in the current color sequence, the sequence will "wrap around" to the first color after using the last color in the sequence. ``` ```If levels is not present, returns the current plotting levels as a double-precision column vector.

Example
If you enter ```      ginit      y      = {-1, 0, 1}      x      = y      z      = y      levels = {-.5, 0, .5}      colors = {"red", "black", "green", "blue"}      glevel(levels)      gcolor(colors)      gplot(x, y, z, "solid", "levels") ``` O-Matrix will generate a plot that changes color at `z = -.5`, `z = 0`, and `z = .5`. (Note that 4 colors are plotted, but there are only 3 color changes.)