MathGroup Archive 2003

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Drawing Polygons

  • To: mathgroup at smc.vnet.net
  • Subject: [mg45250] Re: Drawing Polygons
  • From: bobhanlon at aol.com (Bob Hanlon)
  • Date: Wed, 24 Dec 2003 04:35:52 -0500 (EST)
  • References: <bs94ph$c2u$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

ComplexListPlot[points_, options___] :=
    ListPlot[Map[{Re[#], Im[#]}&, points], options, AxesLabel -> {"Re", "Im"}];

Add another point so that the last point is the same as the first point.

f[n_] := Table[Exp[2.0*Pi*I*a/n], {a, 0, n}];

ComplexListPlot[f[5], PlotStyle -> PointSize[0.02], PlotJoined -> True,
    PlotRange -> {{-1, 1}, {-1, 1}}, AspectRatio -> 1];


Bob Hanlon

In article <bs94ph$c2u$1 at smc.vnet.net>, "flip" <flip_alpha at safebunch.com>
wrote:

<< How can I get the second method to draw all of the points in a closed
polygon?

(* Method 1 ... do not like solid drawing *)

drawPoly[n_] := Module[{datalist},
    datalist = Table[N[{Cos[t], Sin[t]}], {t, 0, 2 Pi, (2Pi)/n}];
    Show[Graphics[Polygon[datalist]], AspectRatio -> Automatic]]

(* Try an example *)

drawPoly[5]

(* Method 2 ... does not draw closed polygons? *)

ComplexListPlot[points_, options___] :=
  ListPlot[Map[{Re[#1], Im[#1]} &, points], options,
    AxesLabel -> {"Re", "Im"}]

f[n_] := Table[N[Exp[2*Pi*I*a/n]], {a, 0, n - 1}]

datalist = f[5]

ComplexListPlot[datalist, PlotStyle -> PointSize[0.02], PlotJoined -> True]

How do I get the last plot to connect all of the points?


  • Prev by Date: Politically incorrect response to Re: a bug in RealDigits? Mathematica 5.0
  • Next by Date: Re: how to 'edit' MatrixForm output to create a new matrix?
  • Previous by thread: RE: Drawing Polygons
  • Next by thread: how to 'edit' MatrixForm output to create a new matrix?