2

Suppose I have data like this

ListPlot[{{1,2,3},{3,2,1}}].
I would like to change the point size of only first two points in both datasets. Although there are many examples similar to this, for example here and here, all of them talk about improving the point size on single dataset. However, in my case I have two datasets.

So, my question is how to control the pointsize of each point in multiple datasets in ListPlot

no-one
  • 1,243
  • 9
  • 14

1 Answers1

3

Post-process the output to change the styles of selected points:

ListPlot[list, PlotStyle -> {Red, Blue}, PlotRange -> {{0, 4}, {0, 4}}] /. 
 Point[x_] :> {x /. p : {_, _} :> If[p[[1]] <= 2, {PointSize[Large], Point[p]}, Point[p]]}

enter image description here

Create a new list wrappping desired data points with Style:

list2 = {{Style[1, Red, PointSize[Large]], Style[2, Red, PointSize[Large]], 3}, 
   {Style[3, Blue, PointSize[Large]], Style[2, Blue, PointSize[Large]], 1}};
ListPlot[list2, PlotStyle -> {Red, Blue},  PlotRange -> {{0, 4}, {0, 4}}]

same picture

kglr
  • 394,356
  • 18
  • 477
  • 896