Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #2928 > unrolled thread

Re: ContourPlot ColorFunction Question

Started by"Sjoerd C. de Vries" <sjoerd.c.devries@gmail.com>
First post2011-06-04 10:20 +0000
Last post2011-06-04 10:20 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  Re: ContourPlot ColorFunction Question "Sjoerd C. de Vries" <sjoerd.c.devries@gmail.com> - 2011-06-04 10:20 +0000

#2928 — Re: ContourPlot ColorFunction Question

From"Sjoerd C. de Vries" <sjoerd.c.devries@gmail.com>
Date2011-06-04 10:20 +0000
SubjectRe: ContourPlot ColorFunction Question
Message-ID<isd0sh$1ne$1@smc.vnet.net>
This looks amazingly similar to an answer I gave on the Mathematica student forum a couple  of days ago (http://forums.wolfram.com/student-support/topics/25780). Together with your sentence "We are trying to plot..." this smells like a homework assignment.

Anyway I can tell you that you shouldn't use a signal '=' in your plot function, but a '==' (but probably, if you want to see multiple contour levels you should delete the right hand side) and the  ColorFunction -> (If[2 #1 > 1, Red, Green] &) part worked for Plot (as I used it on the student forum) where #1 is the x coordinate (see documentation of ColorFunction), so 2 #1 would indeed be the derivative of a function like y = x^2. Alas, for ContourPlot, the ColorFunction gets passed the values of the contour levels. Multiplying this with 2 doesn't have anything to do with derivatives.

For starters, you might want to read some docs about contourplots, and you really should try to understand more deeply what they depict. Otherwise this whole exercise isn't getting you anywhere.

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web