MathGroup Archive 2012

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

Search the Archive

Re: Markers in list plot

  • To: mathgroup at smc.vnet.net
  • Subject: [mg128356] Re: Markers in list plot
  • From: Alexei Boulbitch <Alexei.Boulbitch at iee.lu>
  • Date: Tue, 9 Oct 2012 00:39:07 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: l-mathgroup@wolfram.com
  • Delivered-to: mathgroup-newout@smc.vnet.net
  • Delivered-to: mathgroup-newsend@smc.vnet.net

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!




Hi, Daniel,

You explained it not quite clearly. Bob Hanlon understood that you need a number in the place of each point (see here http://forums.wolfram.com/mathgroup/archive/2012/Oct/msg00046.html).
However, I see also another way to understand you. Namely, that you need each point to de shown by its own marker.

If this what you want, a very simple way is to add the second parentheses around each pair of numbers. That is, if you have a list like this: {{1,2},{3,4},...} you should have {{{1,2}}, {{3,4}},...}. Then you simply plot it with the option PlotMarkers->Automatic. Otherwise you may specify the markers yourself and use them.

To be specific, assume that this is your list (evaluate it):

points = Transpose[{Range[5], RandomReal[{0, 3}, 5]}];

The following adds the parentheses:

doubleParenthesesList = List /@ points;

and this draws the plot:

ListPlot[doubleParenthesesList, PlotMarkers -> Automatic]

For an idea of making custom markers, have a look here and play with its parameters:

vertexDownOpenTriangle =
  Graphics[{EdgeForm[Directive[Thick, Purple]], White,
    Polygon[{{1, 0}, {0, -Sqrt[3]}, {-1, 0}}]}, ImageSize -> 7];

hexagonFilled =
  Graphics[{Pink,
    Polygon[Table[{Cos[2 \[Pi] k/6], Sin[2 \[Pi] k/6]}, {k, 0, 5}]]},
   ImageSize -> 7];
hexagonOpen =
  Graphics[{EdgeForm[Directive[Thick, Pink]], White,
    Polygon[Table[{Cos[2 \[Pi] k/6], Sin[2 \[Pi] k/6]}, {k, 0, 5}]]},
   ImageSize -> 7];

diamondFilled =
  Graphics[{Red, Polygon[Table[{Cos[Pi k/2], Sin[Pi k/2]}, {k, 4}]]},
   ImageSize -> 7];
diamondOpen =
  Graphics[{EdgeForm[Directive[Thick, Red]], White,
    Polygon[Table[{Cos[Pi k/2], Sin[Pi k/2]}, {k, 4}]]},
   ImageSize -> 7];

ListPlot[doubleParanthesesList,
 PlotMarkers -> {vertexDownOpenTriangle, hexagonFilled, hexagonOpen,
   diamondFilled, diamondOpen}]

Like this you can do whatever you like as the markers.

Have fun, Alexei

Alexei BOULBITCH, Dr., habil.
IEE S.A.
ZAE Weiergewan,
11, rue Edmond Reuter,
L-5326 Contern, LUXEMBOURG

Office phone :  +352-2454-2566
Office fax:       +352-2454-3566
mobile phone:  +49 151 52 40 66 44

e-mail: alexei.boulbitch at iee.lu







  • Prev by Date: Re: Clearing all variables and definitions: i.e. "resetting" mathematica
  • Next by Date: Re: Locator + EventHandler
  • Previous by thread: Re: Markers in list plot
  • Next by thread: Animations in Graphs