From: Michel on 16 Apr 2010 06:50 Can I control the colors for individual contour lines using "contour". If I specify the color all contour lines come out with the specified color. If I do not specify the color each lines comes out with its own color. My problem is that the colors vary with the range of the contours. Is it possible to specify (using Colormap ?) a range of colors that are tied to the range of the contours. Michel
From: Rune Allnor on 16 Apr 2010 07:16 On 16 apr, 12:50, "Michel " <sliv...(a)cite.net> wrote: > Can I control the colors for individual contour lines using "contour". I don't know if you can do that through the CONTOUR command interface, but you *can* do it by grabbing the contour lines and plot them with the desired colors. There are several possible methods: 1) Use countour as you would, and then scan the prlot for line objects of some color, and set a new color 2) Get the returned line data from the CONTOUR function, and plot the lines yourself. Rune
From: Rich Ellis on 16 Apr 2010 14:15 The colors of the contour lines map to the current colormap. For example, these statements: contour(peaks,7) colormap(get(gca,'ColorOrder')) color the contour lines using the line colors used for plotting column arrays (which are stored in the axes ColorOrder property). You can control the mapping of color to colormap using the caxis function. You can create a custom colormap containing the colors you want to use: myCM = [1,0,0;0,1,0;0,0,1]; % create an n-by-3 array of RGB values in the range [0..1] contour(peaks,10) colormap(myCM) I'd suggest reading the contour documentation to learn about all the options available to you. At the MATLAB command prompt, type: doc contour Also, follow the link to the contourgroup properties to see what properties you can use to customize your graph. HTHs "Michel " <slivitz(a)cite.net> wrote in message news:hq9fdh$cdu$1(a)fred.mathworks.com... > Can I control the colors for individual contour lines using "contour". > If I specify the color all contour lines come out with the specified > color. > > If I do not specify the color each lines comes out with its own color. My > problem is that the colors vary with the range of the contours. > > Is it possible to specify (using Colormap ?) a range of colors that are > tied to the range of the contours. > > Michel >
|
Pages: 1 Prev: Fast Delaunay neighbourhood calculation Next: Export COMSOL FEM mesh to MATLAB |