Re: Point Labels on XY plot
- To: mathgroup at smc.vnet.net
- Subject: [mg2658] Re: Point Labels on XY plot
- From: ianc (Ian Collier)
- Date: Thu, 30 Nov 1995 21:05:28 -0500
- Organization: Wolfram Research, Inc.
In article <49je5k$53i at dragonfly.wri.com>, Jason
<jj8a at fermi.clas.virginia.edu> wrote:
> Hi,
>
> 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...
>
> Thanks
> Jason
>
> mail replies to jj8a at mcconnell.chem.virginia.edu or
> to this newsgroup
The following example replaces each point in a ListPlot with the
value of the x coordinate as text.
In[44]:=
data = Table[ {x, Sin[x]},{x, 0, 10}];
In[45]:=
gr1 = ListPlot[ data ]
Out[45]=
-Graphics-
In[46]:=
gr2 = gr1 /. Point[{x_,y_}] :> {
Text[ x , {x, y}] }
Out[46]=
-Graphics-
In[47]:=
Show[ gr2 ]
Out[47]=
-Graphics-
I hope this helps.
--Ian
-----------------------------------------------------------
Ian Collier
Technical Sales Support
Wolfram Research, Inc.
-----------------------------------------------------------
tel:(217)-398-0700 fax:(217)-398-0747 ianc at wri.com
Wolfram Research Home Page: http://www.wri.com/
-----------------------------------------------------------