# Control PointSize on a ListPlot

When I thought to vary PointSize on a ListPlot, I expected to find it trivial to do. I've likely overlooked something simple, but I've found it quite curious.

Reducing the problem to some simple examples:

ListPlot[{0.1, 0.2, 0.3}]
ListPlot[{0.1, 0.2, 0.3}, PlotStyle -> (PointSize[#] & /@ {Small, Medium, Large})]
ListPlot[{{0.1}, {0.2}, {0.3}}, PlotStyle -> (PointSize[#] & /@ {Small, Medium, Large})]
ListPlot[{{1, 0.1}, {2, 0.2}, {3, 0.3}}, PlotStyle -> (PointSize[#] & /@ {Small, Medium, Large}), PlotRange -> {{0, 3}, Automatic}]


The 1st plot shows the starting plot with no PlotStyle set.

The 2nd plot shows an attempt to size the individual points. This does not work either, but the documentation for PlotStyle explains why:

The 3rd plot makes each value in the original list its own object. This sizes the points properly, but does not plot them as I would like along the x axis.

The 4th plot adds position values for each object's point, but now I've lost the PointSizing.

Any suggestions on how to do this?

Any explanation of the paradigm involved in doing this properly?

• @Öskå Correct, as illustrated below. :-) Sep 28, 2014 at 15:47
• @Mr.Wizard Correct ;-D
– Öskå
Sep 28, 2014 at 15:50

Your forth input form is not three sets of points but rather one set in {x, y} form. Adding an additional set of brackets gives the output you desire:

ListPlot[{{{1, 0.1}}, {{2, 0.2}}, {{3, 0.3}}},
PlotStyle -> (PointSize /@ {Small, Medium, Large}),
PlotRange -> {{0, 3.1}, Automatic}]


• Ah! Yet another mystery revealed as not a mystery. Thank you. Sep 28, 2014 at 15:51
data = Table[{x, Sin[x]}, {x, -Pi, Pi, 0.1}];
Graphics[{Hue[#2], PointSize[Abs[#2]/50], Point[{#1, #2}]} & @@@ data,
Axes -> True]


Just for fun

data = Table[{x, Sin[x]}, {x, -Pi, Pi, 0.1}];

ListPlot[List /@ data,
GridLinesStyle -> Black,
ImageSize -> 500,
PlotStyle -> PointSize /@ (Abs[Last /@ data]/30),
PlotMarkers -> None,
PlotTheme -> "Marketing"]


BubbleChart[Table[{Sin[2 x], Cos[2 x], Exp[x]}, {x, -2 Pi, 2 Pi, 0.2}],
ColorFunction -> "BeachColors",
Frame -> False,
GridLines -> None,
PlotTheme -> "Marketing"]


• What is the pretty thing Mr.Wizard -:) Sep 28, 2014 at 17:20
• @Mr.Wizard LOL, "circus caterpillar" is a nice notion of what I wanted to create. But, seriously, I just felt that BubbleChart is a tiny bit underrepresented at SE :)
– eldo
Sep 28, 2014 at 20:26

An alternative to breaking the data into individual elements and using different PlotStyles for each element is to wrap individual elements with Style:

data = {0.1, 0.2, 0.3};
colors = {Red, Green, Blue};
pointsizes = PointSize /@ {.06, Medium, Large};


You can apply styling directives to individual elements in several ways:

styleddata1 = Style @@@ Thread[{data, colors, pointsizes}];