RE: Changing the shading contrast in ListContourPlot
- To: mathgroup at smc.vnet.net
- Subject: [mg42356] RE: [mg42331] Changing the shading contrast in ListContourPlot
- From: "Wolf, Hartmut" <Hartmut.Wolf at t-systems.com>
- Date: Wed, 2 Jul 2003 06:36:18 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
>-----Original Message----- >From: JJJ Shen [mailto:jushen1 at hotmail.com] To: mathgroup at smc.vnet.net >Sent: Tuesday, July 01, 2003 2:46 PM >To: mathgroup at smc.vnet.net >Subject: [mg42356] [mg42331] Changing the shading contrast in ListContourPlot > > >Hi, I encountered a question in ListContourPlot and am writing >for help and >advice. > >I have two sets of data, which have different ranges in x- and >y-. (Say, one >set of data is from {{-4,4}, {-3,0}}, while another set is >from {{-1,1}, {0, >1}}) and the z value for the first set is from, say, 0 to 100; >while the z >value for the second set is from, say, 0 to 20. > >When I do > >ListContourPlot[data1]; ListContourPlot[data2] > >both plots have the shading from black to white, but >apparently the white >regions corresponding to very different z value! (in first plot, white >corresponds to (roughly) 100 while in second set it's about >20!) The problem >here is that both data sets have different x- and y- range so I cannot >combine them to get one big data set. > >I was wondering if there's a way to "change/downgrade" the >shading of the >2nd data set? So that the shading of the contour plot of the >second data set >so the shading can be used to compare with the contour plot >from the first >data set? > >I'd also appreciate any suggestions on better ways to present >the plots. I'll give you an example for ContourPlot, you might try to adapt it to your case for ListContourPlot. Execute this: cp1 = ContourPlot[Sin[x^2 + y^2], {x, -4, 4}, {y, -3, 0}, AspectRatio -> Automatic, Contours -> Range[-1, 1, .1], PlotPoints -> 150, ColorFunction -> (GrayLevel[(# + 1)/2] &), ColorFunctionScaling -> False] cp2 = ContourPlot[Sin[x^2 + y^2], {x, -1.5, 1.5}, {y, 0, 1}, AspectRatio -> Automatic, Contours -> Range[-1, 1, .1], PlotPoints -> 75, ColorFunction -> (GrayLevel[(# + 1)/2] &), ColorFunctionScaling -> False] Show[cp1, cp2] You see how both plots join smoothly. The secret is to make use of the options Contours, ColorFunction, and ColorFunctionScaling. -- Hartmut Wolf