color function for ContourPlot
- To: mathgroup at christensen.cybernetics.net
- Subject: [mg0183] color function for ContourPlot
- From: Fredo Sartori <sartori at thetis.zedat.fu-berlin.de>
- Date: Sun, 14 May 1995 19:51:26 -0400
- Organization: Freie Universitaet Berlin
Producing a contor plot using ColorFunction->Hue gives the same color for the lowest as for the highest regions in the plot whic his rather confusing.The same problem is encountered when making a surface graphics with ColorFunction->Hue. In the latter case creating an module like the following one solves the problem: rainbowColor[array_, label_] := Module[ {min, max, length}, min = Min[array]; max = Max[array]; length = Length[array[[1]]]; ListPlot3D[array, Table[Hue[1./(1.1*(max-min))*array[[i]][[j]]], {i, length-1}, {j, length-1}] ] ] Creating an analog module for the ConturGraphics fails: rainbowContur[array_, label_] := Module[ {min, max, length}, min = Min[array]; max = Max[array]; length = Length[array[[1]]]; ListContourPlot[array, Table[Hue[0.9/(max-min)*array[[i]][[j]]], {i, length-1}, {j, length-1}] ] ] All that is produced is the following error message: ListContourPlot::nonopt: Options expected (instead of {<<36>>}) beyond position 1 in ListContourPlot[{<<37>>}, {<<36>>}]. An option must be a rule or a list of rules. Any suggestions? Thanks in advance, Fredo -- Fredo Sartori ! Freie Universitaet Berlin sartori at chemie.fu-berlin.de ! Institut fuer Kristallographie phone +49 30 838-4627 ! Takustrasse 6 fax +49 30 838-5281 ! D-14195 Berlin 33, FRG