Re: Point Labels on XY plot
- To: mathgroup at smc.vnet.net
- Subject: [mg2656] Re: Point Labels on XY plot
- From: kluge at seuss.cc.utexas.edu ()
- Date: Thu, 30 Nov 1995 21:05:07 -0500
- Organization: Computation Center, University of Texas
> I have a large 2D dataset and the points are dispersed all over. > I would like to know if it is possible to plot these points with > each data points drawn as the point labels, say data point #, > rather than the usual way where all the points are drawn as a > dot or a triangle etc... Jason, This seems to do just what you are asking about: NB8000Data = {{1, 337.81}, {2, 445.21}, . . . {75, 1102.06}}; i=1; Markers = Graphics[Text[FontForm[i++, {"Times-Roman",12 }], #]&/@NB8000Data]; Show[Markers]; Oh, you want explanations too? Heh. Well, Text[FontForm[i++, {"Times-Roman",12 }], #]& is what mathematica calls a pure function. The arguments to a pure function are referred to within the function with #. /@ applies the pure function to each element of our list. The elements of the list are the coordinates of the point in question. So this winds up drawing the value of i in Times-Roman 12 point font, at a point then incrementing i, then doing the same for the next point, etc. Have fun, Alex