|
|
Re: Labeling points in ListPlot
Posted:
Sep 5, 2005 2:29 AM
|
|
Needs["Graphics`"];
data=Table[Random[],{10},{2}]; labels=Table["p"<>ToString[n],{n,Length[data]}];
ListPlot[data,Frame->True,Axes->False, PlotStyle->{Red,AbsolutePointSize[4]}, Epilog->(Text[StyleForm[#[[1]], FontFamily->"Times New Roman", FontSize->12], #[[2]],{1.25,1.25}]&/@Thread[{labels,data}]), PlotRange->{{-.1,1.1},{-.1,1.1}}];
Show[Graphics[{(Text[StyleForm[#[[1]], FontFamily->"Times New Roman", FontSize->12], #[[2]],{1.25,1.25}]&/@Thread[{labels,data}]), Red,AbsolutePointSize[4],Point/@data}], Frame->True, PlotRange->{{-.1,1.1},{-.1,1.1}}];
Bob Hanlon
> > From: Steve Gray <stevebg@adelphia.net> > Date: 2005/09/04 Sun AM 03:02:10 EDT > Subject: Labeling points in ListPlot > > I have a series of coordinates such as {{x1,y1},{x2,y2},...,{xn,yn}}, a > few dozen at most. I want to put labels on the points such as p1, > p2,...,pn, etc. in some desired typeface and size. I also need to > control the small offset between the label and the dot representing the > point. > Does Epilog have anything to do with this? Help doesn't say much about it. > Thank you for any info. > > Steve Gray > >
|
|