MathGroup Archive 1995

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

Search the Archive

Re: Point Labels on XY plot

  • Subject: [mg2656] Re: Point Labels on XY plot
  • From: kluge at ()
  • Date: Thu, 30 Nov 1995 21:05:07 -0500
  • Approved:
  • Distribution: local
  • Newsgroups: wri.mathgroup
  • 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...


   This seems to do just what you are asking about:

   NB8000Data = {{1, 337.81},
                 {2, 445.21},
                 {75, 1102.06}};


   Markers = Graphics[Text[FontForm[i++, {"Times-Roman",12 }], #]&/@NB8000Data];


   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,


  • Prev by Date: Re: derivatives of indexed variables
  • Next by Date: Re: X-FrontEnd crashes upon certain keystrokes
  • Previous by thread: Re: derivatives of indexed variables
  • Next by thread: Re: Point Labels on XY plot