0

I have two ListContourPlots which have different min and max height values.

plot1 = ListContourPlot[{{1, 1, 2}, {1, 2, 4}, {1, 3, 6}, {2, 1, 
    3}, {2, 2, 1}, {2, 3, 1}, {3, 1, 2}, {3, 2, 9}, {3, 3, 12}}, 
  Contours -> Range[0, 20, 1], PlotLegends -> Automatic]

plot2 = ListContourPlot[{{1, 1, 13}, {1, 2, 17}, {1, 3, 16}, {2, 1, 
    3}, {2, 2, 20}, {2, 3, 19}, {3, 1, 2}, {3, 2, 19}, {3, 3, 13}}, 
  Contours -> Range[0, 20, 1], PlotLegends -> Automatic]

I would like to ensure that same height values get the same color, ie both plots should have a scale from 0 to 20.

cormullion
  • 24,243
  • 4
  • 64
  • 133
RMMA
  • 2,710
  • 2
  • 18
  • 33

1 Answers1

0

What you need is a ColorFunction of your choice and ColorFunctionScaling->False:

CoolColor[ z_ ] := RGBColor[z/20, 1 - z/20, 1]

plot1 = ListContourPlot[{{1, 1, 2}, {1, 2, 4}, {1, 3, 6}, {2, 1, 
    3}, {2, 2, 1}, {2, 3, 1}, {3, 1, 2}, {3, 2, 9}, {3, 3, 12}}, 
  Contours -> Range[0, 20, 1], ColorFunction -> CoolColor, 
  ColorFunctionScaling -> False]

plot2 = ListContourPlot[{{1, 1, 13}, {1, 2, 17}, {1, 3, 16}, {2, 1, 
    3}, {2, 2, 20}, {2, 3, 19}, {3, 1, 2}, {3, 2, 19}, {3, 3, 13}}, 
  Contours -> Range[0, 20, 1], ColorFunction -> CoolColor, 
  ColorFunctionScaling -> False]
A Rizona
  • 93
  • 6
  • @Nasser With the same ColorFunction it has the same scale? Actually I am using MMA 8 and can't use PlotLegends so I removed it and the results are different. – A Rizona Aug 08 '13 at 14:36
  • @Nasser Hm I don't get any kind of PlotLegend or PlotLegends work for MMA8 with ListContourPlot, but now I understand what you mean. My answer refered to the "same height values get the same colour". – A Rizona Aug 08 '13 at 14:50