这样的方法没代表性吧。 说白了,就是把这些node练成多边形,然后根据结点的温度填上结点的颜色。因为软件填色的本身设定,整个多边形就填上色。Matlab 可以做,Mathematica也可以做。因为你把那些结点关系省略了,我就用Interpolation来补充一下了。
- data = Import["C/nodetemp.txt", "Table"]
- data1 = Transpose[{data[[All, 1 ;; 3]], data[[All, 4]]}];
- b = Max@data[[All, 4]];
- a = Min@data[[All, 4]];
- ff = Interpolation[data1, InterpolationOrder -> 1]
- tt = RegionPlot3D[
- 0 <= x <= 0.2 && 0 <= y <= 0.3 && 0 <= z <= 0.2, {x, 0, 0.2}, {y,
- 0, 0.3}, {z, 0, 0.2}, Mesh -> {8, 5, 6}, PlotPoints -> {10, 7, 8},
- MaxRecursion -> 0];
- cls = Map[(ColorData["TemperatureMap"][(ff @@ # - a)/(b - a)]) &,
- tt[[1, 1]]];
- Row[{Graphics3D[{GraphicsComplex[
- tt[[1, 1]], {Opacity[0.8], EdgeForm[],
- Cases[tt[[1]], Polygon[__], {0, Infinity}]},
- VertexColors -> cls]}, Axes -> True,
- AxesLabel -> {"x", "y", "z"}, Boxed -> False, BoxRatios -> 1,
- ViewPoint -> {-2, -2, 1}, ImageSize -> 350],
- Graphics[DensityPlot[(y - a)/(b - a), {x, 0, 0.5}, {y, 22, 25},
- ColorFunction -> (ColorData["TemperatureMap"][#1] &)][[1]],
- Ticks -> {None, Range[22, 25, 0.5]}, Frame -> False, Axes -> True,
- AspectRatio -> 10, ImageSize -> 45]}, Spacer[5]]
得到:
|