Graphing random points on the XY-plane
You can use RandomPoint
with InfinitePlane
and draw lines using InfiniteLine
:
plane = InfinitePlane[{{0, 0, 0}, {1, 0, 0}, {0, 1, 0}}];
pts = RandomPoint[plane, 20, {{-10, 10}, {-10, 10}, {0, 0}}];
Graphics3D[{plane, Red, InfiniteLine[#, {0, 0, 1}] & /@ pts, Blue,
Sphere[pts, .1]}, PlotRange -> {{-10, 10}, {-10, 10}, {-5, 5}}]
Maybe this will work for you.
First define a function for generating $n$ random points on the xy-plane.
pts[n_] := {#1, #2, 0} & @@@ RandomReal[{-10., 10.}, {n, 2}]
Then
SeedRandom[42];
Module[{n = 20, p0} ,
p0 = pts[n];
Graphics3D[
{{AbsolutePointSize[4], Point[p0]},
{Red, Thick, HalfLine[#, {0, 0, 1}] & /@ p0}},
PlotRange -> {{-10, 10}, {-10, 10}, {0, 10}}]]