MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: ContourListPlot

  • To: mathgroup at smc.vnet.net
  • Subject: [mg66502] Re: ContourListPlot
  • From: Peter Pein <petsie at dordos.net>
  • Date: Wed, 17 May 2006 03:29:44 -0400 (EDT)
  • References: <e4biq2$19v$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

sepp schrieb:
> I plot xyz data in Mathematica with the ContourListPlot command. the x, y axis
> are labelled with the meshrange command. this works fine, but sometimes
> I would prefer only to display some parts of my data, so if the
> original data goes from {x1,x2}, then I would like to show only
> {x1a,x2a} with x1a>x1 and x2a<x2.
> Is there a built in function in Mathematica to realise this?
> thanks!
> 

Hello Sepp,

a simple example:

data = Table[{x, y, Sin[x*y]}, {x, -3, 3, 1/5}, {y, -3, 3, 1/5}];
ListContourPlot[data[[All,All,3]], MeshRange -> {{-3, 3}, {-3, 3}}];
<Plot omitted>
Say, you want the range 0<=x<=1/2, -1<=y<=0. Then

data2 =
    DeleteCases[Pick[data, Map[0 <= #1[[1]] <= 1/2 && -1 <= #1[[2]] <= 0 & , data, {2}]], {}];

selects the appropriate points; but the range of the values is not necessarily {{0,1/2},{-1,0}}.
So you have to determine the true range:

mr = (Through[{Min, Max}[#1]] & ) /@ Transpose[Flatten[data2[[All,All,{1, 2}]], 1]];

just to check it:

Dimensions[data2]
--> {3, 6, 3}

N[mr]
--> {{0., 0.4}, {-1., 0.}}

ListContourPlot[data2[[All,All,3]], MeshRange -> mr];

shows the restricted Area.

hth,
   Peter


  • Prev by Date: Re: compound symmetrical primes
  • Next by Date: Re: Reconstructing data points from a InterpolatingFunction object
  • Previous by thread: RE: ContourListPlot
  • Next by thread: what is K$