I am fairly new to Mathematica and I have two quick questions on using it for a Hydrology and Hydrogeology class. One is about data interpolation and interpolating without any data defined in an area. First question: I have a set of data:
data = {
{875, 3375, 632}, {500, 4000, 634}, {2250, 1250, 654.2}, {3000, 875, 646.4},
{2560, 1187, 641.5}, {1000, 750, 650}, {2060, 1560, 634}, {3000, 1750, 643.3},
{2750, 2560, 639.4}, {1125, 2500, 630.1}, {875, 3125, 638}, {1000, 3375, 632.3},
{1060, 3500, 630.8}, {1250, 3625, 635.8}, {750, 3375, 625.6}, {560, 4125, 632},
{185, 3625, 624.2}
}
where $x$ and $y$ are coordinates in space and $z$ is the elevation of bedrock underground. What I want to do is to have a "smooth" and not jagged contour plot. I created the following code which is extremely cumbersome and inefficient, but works:
ListContourPlot[data,
Contours -> Function[{min, max}, Range[min, max, 2]],
ColorFunction -> "TemperatureMap",
Epilog -> {PointSize[.015],
Point[{{875, 3375}, {500, 4000}, {2250, 1250}, {3000, 875}, {2560,
1187}, {1000, 750}, {2060, 1560}, {3000, 1750}, {2750,
2560}, {1125, 2500}, {875, 3125}, {1000, 3375}, {1060,
3500}, {1250, 3625}, {750, 3375}, {560, 4125}, {185, 3625}}],
Text[GB2, {875, 3450}], Text[GB4, {500, 4070}],
Text[220, {2250, 1330}], Text[221, {3000, 940}],
Text[222, {2560, 1250}], Text[223, {1050, 820}],
Text[224, {2060, 1630}], Text[225, {3000, 1810}],
Text[226, {2750, 2630}], Text[227, {1125, 2580}],
Text[10, {875, 3190}], Text[15, {1000, 3430}],
Text[16, {1100, 3550}], Text[17, {1250, 3700}],
Text[18, {750, 3455}], Text[20, {630, 4125}],
Text[21, {185, 3690}],
Text[Style[626.2, Bold, Medium], {390, 3590}],
Text[Style[628.2, Bold, Medium], {600, 3590}],
Text[Style[630.2, Bold, Medium], {800, 3590}],
Text[Style[632.2, Bold, Medium], {1000, 3640}],
Text[Style[634.2, Bold, Medium], {1200, 3375}],
Text[Style[636.2, Bold, Medium], {1500, 3390}],
Text[Style[638.2, Bold, Medium], {1301, 1669}],
Text[Style[640.2, Bold, Medium], {1301, 1469}],
Text[Style[642.2, Bold, Medium], {1301, 1269}],
Text[Style[644.2, Bold, Medium], {1301, 1100}],
Text[Style[646.2, Bold, Medium], {1160, 1000}],
Text[Style[648.2, Bold, Medium], {1470, 1000}],
Text[Style[650.2, Bold, Medium], {1500, 850}],
Text[Style[652.2, Bold, Medium], {2000, 1070}]}]
The ListContourPlot
only uses a linear interpolation for the data. I tried adding in
InterpolationOrder -> 5
Any other order does not really change the contour lines. I had a problem using
ContourLabels -> All
; otherwise I would not manually place text for labeling each contour and similarly for labeling each data point.
My second question: The contour plot does not extend contours out past where points are interpolated (I think).
Is there any way to continue these contour lines and extend them to the graph's boundaries? Normally, one would hand draw these contours and extend them.
Thanks so much!
InterpolationOrder
set to, say 3. According to the documentation, "With a limited number of points, irregular data is linearly interpolated". So, to get smoothing, you need more data points, it would seem. Interpolating is for between points: you cannot "extrapolate" beyond the given data range by interpolating. $\endgroup$ContourPlot[Interpolation[data][x, y], {x, 400, 3000}, {y, 900, 4000}, ColorFunction -> "TemperatureMap", Contours -> 30]
results in i.stack.imgur.com/2YqPb.png $\endgroup$