Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1995
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1995

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

Search the Archive

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



   





  • Prev by Date: getting eps files from mathematica on a mac
  • Next by Date: Re: LUDecomposition output?
  • Previous by thread: Re: Point Labels on XY plot
  • Next by thread: Point Labels on XY plot