Graphics 图形学中的凸形图-Mathematica

Graphics 图形学中的凸形图-Mathematica,graphics,wolfram-mathematica,convex-hull,Graphics,Wolfram Mathematica,Convex Hull,尝试使用CalculationAlgeometry软件包中的PlanarGraphPlot绘制凸形图时,在图形中使用时不起作用 你知道如何用图形绘制凸出曲线吗 Needs["ComputationalGeometry`"] pts = RandomReal[{0, 10}, {60, 2}]; Graphics[ { Point@pts, FaceForm[], EdgeForm[Red], Polygon@pts[[ConvexHull[pts]]] } ] 或 不确定

尝试使用CalculationAlgeometry软件包中的PlanarGraphPlot绘制凸形图时,在图形中使用时不起作用

你知道如何用图形绘制凸出曲线吗

Needs["ComputationalGeometry`"]
pts = RandomReal[{0, 10}, {60, 2}];

Graphics[
 {
  Point@pts,
  FaceForm[], EdgeForm[Red],
  Polygon@pts[[ConvexHull[pts]]]
  }
 ]


不确定到底想要什么。也许下面的代码可以让你开始

 pts = RandomReal[{-10, 10}, {20, 2}]
(*
Out[1]= {{1.7178, -1.11179}, {-7.10708, -8.1637},
 {8.74461, -2.42551}, {6.64129, -2.87008}, {9.9008, 6.47825},
 {8.27081, 9.94116}, {9.97325, 7.61094}, {-2.7876, 9.70449},
 {-3.69357, 0.0253506}, {-0.503817, -1.98649}, {6.3056, -1.16892},
 {-4.69983, -1.93242}, {-6.09983, 7.49229}, {8.08545, 6.67951},
 {-6.91195, 8.34752}, {-2.63136, 6.0506}, {-0.130006, 2.10929},
 {1.64401, 3.32165}, {0.611335, -8.11364}, {-2.03548, -9.37277}}
*)
With[{hull = pts[[Graphics`Mesh`ConvexHull[pts]]]}, 
  Graphics[Line[Append[hull, First[hull]]]]]

哎哟。我忘了如何附加gif。你可能是在开玩笑,但以防万一你不是:按编辑窗口上方的小图形按钮以提供链接或路径。我通常导出到PNG,因为它比GIF有更好的颜色分辨率,如果我没弄错的话。投票删除。没有gif,没有回答。不是开玩笑。事实上,我做得很正确,但没有图像显示出来。为jpeg而不是gif工作?!这很奇怪;我通常用GIF表示StackOverflow。实际上,你已经用Faceform[white]解决了这个问题。是否有其他方式,因为我可能需要在下面显示一些图形ConvexHull@500如果你不想看到这些点,没有什么比省去画它们的线更容易的了,我也包括了这条线,以便于说明(
Point@pts
)。我不知道我是否理解你的意思。我也不明白你关于
Faceform[white]
的问题。我使用了
Faceform[]
,这使得多边形是透明的。谢谢。抱歉搞混了,我现在已经弄明白了!
 pts = RandomReal[{-10, 10}, {20, 2}]
(*
Out[1]= {{1.7178, -1.11179}, {-7.10708, -8.1637},
 {8.74461, -2.42551}, {6.64129, -2.87008}, {9.9008, 6.47825},
 {8.27081, 9.94116}, {9.97325, 7.61094}, {-2.7876, 9.70449},
 {-3.69357, 0.0253506}, {-0.503817, -1.98649}, {6.3056, -1.16892},
 {-4.69983, -1.93242}, {-6.09983, 7.49229}, {8.08545, 6.67951},
 {-6.91195, 8.34752}, {-2.63136, 6.0506}, {-0.130006, 2.10929},
 {1.64401, 3.32165}, {0.611335, -8.11364}, {-2.03548, -9.37277}}
*)
With[{hull = pts[[Graphics`Mesh`ConvexHull[pts]]]}, 
  Graphics[Line[Append[hull, First[hull]]]]]