Re: Re: L-shaped ListContourPlot

• To: mathgroup at smc.vnet.net
• Subject: [mg97304] Re: [mg97272] Re: L-shaped ListContourPlot
• From: Curtis Osterhoudt <cfo at lanl.gov>
• Date: Tue, 10 Mar 2009 05:37:04 -0500 (EST)
• Organization: LANL
• References: <goqpdt\$lri\$1@smc.vnet.net> <goqugi\$ngc\$1@smc.vnet.net> <200903091018.FAA13285@smc.vnet.net>

```If you change the InterpolationOrder option, the problem should go away. Try something like

ListContourPlot[data,
ColorFunction ->
Function[{z}, ColorData["VisibleSpectrum"][380 + 370 z]],
PlotRange -> All,
RegionFunction -> Function[{x, y, z}, (y < 5) || (x < 5)],
Epilog -> Point[data[[All, {1, 2}]]],
InterpolationOrder -> 0]

On Monday 09 March 2009 04:18:35 am Flavio wrote:
> Thank you for your explanation, now I understand the problem. I think
> however that this kind of behaviour of ListContourPlot and
> RegionFunction is quite unstable, in fact it appears for very thin
> gaps of points: my example had a very raw mesh, but even if I use a
> very fine mesh the same thing happens, if the interval appears to be a
> little outside the data.
>
> Kind regards,
> Flavio Cimolin
>
>
> On 6 Mar, 11:39, Jens-Peer Kuska <ku... at informatik.uni-leipzig.de>
> wrote:
> > Hi,
> >
> > try
> >
> > ListContourPlot[data, ColorFunction -> "Rainbow", PlotRange -> All,
> >   RegionFunction -> Function[{x, y, z}, (y < 5) || (x < 2)],
> >   Epilog -> (Point[Take[#, 2]] & /@ data)]
> >
> > and you see that at x==2 are data points, for 2<x<16 thre are no
> > data points and making a cut in the drawing where
> > no data exist will cause errors in the interpolation of the
> > data for drawing.
> >
> > Regards
> >    Jens
> >
> > Flavio wrote:
> > > Hello,
> >
> > > I have some pressure data coming from an external FE solver, which I
> > > want to plot in Mathematica, for a L-shaped domain. I have tried to
> > > use ListContourPlot (or ListDensityPlot), but I have found an
> > > unexpected behaviour in controlling the shape of the domain with the
> > > RegionFunction option. I am using Mathematica 6.0.
> >
> > > The command I use for the plot is the following:
> >
> > > ListContourPlot[data, ColorFunction -> "Rainbow", PlotRange -> All,
> > >  RegionFunction -> Function[{x, y, z}, (y < 5) || (x < 2)]]
> >
> > > Now... if I keep the (x < 2), everything goes well, but if I put (x <
> > > 3), instead of having an L-shaped domain, I obtain a strange oblique
> > > boundary. Is there an explanation to this?
> >
> > > In order to test it, you can consider the following data:
> >
> > > data = {{0.`, 0.`, 39.99`}, {0.`, 1.`, 39.99`}, {0.`, 2.`,
> > >     40.4`}, {0.`, 3.`, 42.24`}, {0.`, 4.`, 41.88`}, {2.`, 0.`,
> > >     39.37`}, {2.`, 1.`, 39.32`}, {2.`, 2.`, 39.56`}, {2.`, 3.`,
> > >     44.06`}, {2.`, 4.`, 41.01`}, {4.`, 0.`, 35.72`}, {4.`, 1.`,
> > >     35.63`}, {4.`, 2.`, 35.48`}, {4.`, 3.`, 37.45`}, {4.`, 4.`,
> > >     29.15`}, {6.`, 0.`, 30.95`}, {6.`, 1.`, 30.89`}, {6.`, 2.`,
> > >     30.59`}, {6.`, 3.`, 29.59`}, {6.`, 4.`, 29.7`}, {8.`, 0.`,
> > >     27.12`}, {8.`, 1.`, 27.12`}, {8.`, 2.`, 27.03`}, {8.`, 3.`,
> > >     26.33`}, {8.`, 4.`, 26.99`}, {10.`, 0.`, 23.94`}, {10.`, 1.`,
> > >     23.93`}, {10.`, 2.`, 23.9`}, {10.`, 3.`, 23.56`}, {10.`, 4.`,
> > >     23.7`}, {12.`, 0.`, 21.05`}, {12.`, 1.`, 21.04`}, {12.`, 2.`,
> > >     20.99`}, {12.`, 3.`, 20.75`}, {12.`, 4.`, 20.64`}, {14.`, 0.`,
> > >     18.44`}, {14.`, 1.`, 18.42`}, {14.`, 2.`, 18.29`}, {14.`, 3.`,
> > >     17.82`}, {14.`, 4.`, 17.37`}, {16.`, 0.`, 16.39`}, {16.`, 1.`,
> > >     16.36`}, {16.`, 2.`, 16.07`}, {16.`, 3.`, 14.82`}, {16.`, 4.`,
> > >     12.77`}, {18.`, 0.`, 15.3`}, {18.`, 1.`, 15.28`}, {18.`, 2.`,
> > >     14.93`}, {18.`, 3.`, 12.67`}, {18.`, 4.`, 11.7`}, {20.`, 0.`,
> > >     15.15`}, {20.`, 1.`, 15.14`}, {20.`, 2.`, 14.7`}, {20.`, 3.`,
> > >     12.46`}, {20.`, 4.`, 12.08`}, {0.`, 5.`, 41.35`}, {0.`, 6.`,
> > >     40.95`}, {0.`, 7.`, 40.94`}, {0.`, 8.`, 41.23`}, {0.`, 9.`,
> > >     41.7`}, {2.`, 5.`, 37.5`}, {2.`, 6.`, 38.08`}, {2.`, 7.`,
> > >     39.48`}, {2.`, 8.`, 40.55`}, {2.`, 9.`, 41.42`}, {17.`,
> > >     5.`, -8.22`}, {17.`, 6.`, -4.96`}, {17.`, 7.`, -3.1`}, {17.`,
> > >     8.`, -1.44`}, {17.`, 9.`, -0.29`}, {19.`, 5.`, 10.19`}, {19.`,
> > >     6.`, 5.42`}, {19.`, 7.`, 2.01`}, {19.`, 8.`, 0.52`}, {19.`, 9.`=
> ,
> > >     0.09`}};
> >
> > > Thank you for your help.
> >
> > > Kind regards,
> > > Flavio Cimolin
>
>
>

--
==========================================================
Curtis Osterhoudt
cfo at remove_this.lanl.and_this.gov
PGP Key ID: 0x4DCA2A10
Please avoid sending me Word or PowerPoint attachments
See http://www.gnu.org/philosophy/no-word-attachments.html
==========================================================

```

• Prev by Date: Re: Re: Re: Re: Re: typsetting bug still present in
• Next by Date: Re: Re: Re: Mathematica 7.0.1.0 and some General
• Previous by thread: Re: L-shaped ListContourPlot
• Next by thread: Re: L-shaped ListContourPlot