Help coloring plot
- To: mathgroup@smc.vnet.net
- Subject: [mg11240] Help coloring plot
- From: tpa@radix.net (Paul Bublitz)
- Date: Mon, 2 Mar 1998 23:11:39 -0500
- Organization: TP Associates
I have a class assignment (hi Ken) to create a graph consisting of data
from a table plotted blue, a single point plotted in red, and lines
connecting the single point to the table plotted in greenish yellow.
I can plot each (point, table, and line) separately in the specified
colors. When I combine the individual plots into a module as shown
below, I only get a single color. How can I plot this in three
colors?
plotpoly[sides_,point_]:=
Module[{p1,p2,p3,data},
data=Table[{Cos[I 2.\[Pi]/sides],Sin[I 2.\[Pi]/sides]},{I,sides}];
p1=ListPlot[data,PlotStyle->PointSize[.03],DefaultColor-
>RGBColor[0,0,1],DisplayFunction->Identity];
p2=Graphics[{PointSize[.03],Point[point]},DefaultColor-
>RGBColor[1,0,0]];
p3=Graphics[Table[Line[{point,data[[I]]}],{I,sides}],DefaultColor-
>RGBColor[.8,1,0];
Show[{p1,p2,p3},Axes->False,AspectRatio->Automatic,
DisplayFunction->$DisplayFunction]
-------------
Paul Bublitz
tpa@radix.net
- Follow-Ups:
- Re: Help coloring plot
- From: Sean Ross <seanross@worldnet.att.net>
- Re: Help coloring plot