2
$\begingroup$

A simple question but, unfortunately, I could not find the answer. Suppose I have a ListContourPlot built from some data set, e.g.,

plot = ListContourPlot[RandomReal[1, {50, 3}], ContourLabels -> All]; Show[plot, Graphics[{Red, PointSize[Large], Point[{0.5, 0.5}]}]] 

ListContourPlot example

I need to be able to determine whether a particular point lies within a given range on this contour plot. For example, I want to check if the red point with coordinates {0.5,0.5} on my contour plot would fall between the contour lines 0.4 and 0.6. Notice that this point is not necessarily a part of the original data set used to make the plot. Just a True/False result of such a test would do.

$\endgroup$

1 Answer 1

2
$\begingroup$
pts = RandomReal[1, {50, 3}]; plot = ListContourPlot[pts, ContourLabels -> All]; Show[plot, Graphics[{Red, PointSize[Large], Point[{0.5, 0.5}]}]] 

Mathematica graphics

ip = Interpolation[pts, InterpolationOrder -> All]; 0.4 < ip[0.5, 0.5] < 0.6 

False

$\endgroup$
0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.