Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Markers in list plot

259 views
Skip to first unread message

Daniele

unread,
Oct 5, 2012, 2:40:10 AM10/5/12
to
Hi All,
i would like to put personal PlotMarkers in ListPlot in the following way:

ListPlot[{{x1,y1},{x2,y2},...,{xn,yn}}]

in such a way that the first point has as a marker number one, the second number two and so on.. is that possible?

Thanks in advance!

Bob Hanlon

unread,
Oct 6, 2012, 2:05:50 AM10/6/12
to
data = Table[{n, Prime[n]}, {n, 10}];

With PlotMarkers (n data lists with one point each):

ListPlot[List /@ data,
PlotMarkers ->
ToString /@ Range[Length[data]]]

With Text labels (single data list with n points):

ListPlot[data,
PlotStyle -> White,
Epilog -> (n = 1;
Text[n++, #] & /@
data)]


Bob Hanlon

Bill Rowe

unread,
Oct 6, 2012, 2:07:48 AM10/6/12
to
On 10/5/12 at 2:49 AM, daniele....@alice.it (Daniele) wrote:

>Hi All, i would like to put personal PlotMarkers in ListPlot in the
>following way:

>ListPlot[{{x1,y1},{x2,y2},...,{xn,yn}}]

>in such a way that the first point has as a marker number one, the
>second number two and so on.. is that possible?

Yes. Here is one way to do that

len = 5;
data = Sort@RandomReal[1, {len, 2}];
ListPlot[List /@ data,
PlotMarkers -> (Style[ToString@#, {12, Black}] & /@ Range[len]),
Frame -> True, PlotRange -> All]


0 new messages