6
$\begingroup$

Consider the following list for example

ListPlot[{{0, 1}, {1, 4}, {3, 2}, {5, 6}, {9, 5}, {10, 8}}]

How can I obtain a graph, in an elegant simple manner, in which the size of the points monotonically increase with the index of the list?

  • smallest point for first index (in this case {0,1})
  • largest point for last index (in this case {10,8})
$\endgroup$
10
$\begingroup$
data = {{0, 1}, {1, 4}, {3, 2}, {5, 6}, {9, 5}, {10, 8}};
ListPlot[{#} & /@ data, 
 PlotStyle -> (PointSize /@ Subdivide[0.02, 0.06, 6]), Frame -> True]

enter image description here

$\endgroup$
6
$\begingroup$
pts = {{0, 1}, {1, 4}, {3, 2}, {5, 6}, {9, 5}, {10, 8}}
BubbleChart[MapIndexed[Append[#, First@#2] &, pts]]
$\endgroup$
1
$\begingroup$

You can also control the point sizes using the option PlotMarkers:

pts = {{0, 1}, {1, 4}, {3, 2}, {5, 6}, {9, 5}, {10, 8}};
{smin, smax} = {15, 40};
markers = Thread[{"●", Range[smin, smax, (smax - smin)/(Length[pts] - 1)]}];

ListPlot[List /@ pts, PlotMarkers -> markers, 
  PlotRangePadding -> 1, Frame -> True, Axes -> False]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.