5
$\begingroup$

The documentation indicates simple, consistent, and intuitive usage for wrappers in ListLinePlot and ListLinePlot3D. However, the Style wrapper for ListLinePlot doesn't seem to work.

For example, consider the examples below. The Labeled wrapper works as the documentation indicates, the same way for ListLinePlot and ListLinePlot3D, and how you would expect (examples 1 and 2). The Style wrapper works this way for ListLinePlot3d (example 3) but not for ListLinePlot (example 4).

Can I fix this or get around it? I would like to stylize individual points in ListLinePlot.

1 ) ListLinePlot3D with Labeled (ok)

ListLinePlot3D[{{2.1, Labeled[2.9, "hello"], 2.8, 1.9}, {2.2, 2.7, 
   1.1, 2.2}, {2.3, 1.7, 2.3, 1.7}}, PlotMarkers -> {Automatic, 0.03}]

1

2 ) ListLinePlot with Labeled (ok)

ListLinePlot[{{2.1, Labeled[2.9, "hello"], 2.8, 1.9}, {2.2, 2.7, 1.1, 
   2.2}, {2.3, 1.7, 2.3, 1.7}}, PlotMarkers -> {Automatic, 0.05}]

2

3 ) ListLinePlot3D with Style (ok)

ListLinePlot3D[{{2.1, Style[2.9, Red], 2.8, 1.9}, {2.2, 2.7, 1.1, 
   2.2}, {2.3, 1.7, 2.3, 1.7}}, PlotMarkers -> {Automatic, 0.03}]

3

4 ) ListLinePlot with Style (broken)

ListLinePlot[{{2.1, Style[2.9, Red], 2.8, 1.9}, {2.2, 2.7, 1.1, 
   2.2}, {2.3, 1.7, 2.3, 1.7}}, PlotMarkers -> {Automatic, 0.05}]

4


  • Mathematica Version 13.0.1.0
  • macOS Big Sur Version 11.6.5
$\endgroup$
4
  • 2
    $\begingroup$ Repeatable in Mma 13.0.1 on Win 10 Pro. $\endgroup$
    – Edmund
    May 3, 2022 at 0:14
  • $\begingroup$ Just to play Devil's Advocate, I wonder if ListLinePlot3D is doing something that it shouldn't be doing. In the manual for both ListLinePlot and ListLinePlot3D Style is applied to a complete dataset rather than an individual data point. Also, when Style is applied to a dataset in ListLinePlot, it is the line that is modified and not the plot marker. $\endgroup$
    – JimB
    May 3, 2022 at 2:14
  • $\begingroup$ @JimB It seems unlikely to me ListLinePlot3D's (arguably expected) feature is a bug and Style not working on points for ListLinePlot is intended behavior, considering it is unnecessarily restrictive. All other wrappers I've tested work as expected. Only Style, only for ListLinePlot, only for points, is the exception. $\endgroup$ May 3, 2022 at 18:49
  • 1
    $\begingroup$ Outliers are in the eyes of the beholder. But my point is that I'm not seeing in the documentation that Style should work on an individual point. Doing so would be a nice feature but it's not clear to me that it has been advertised as such. $\endgroup$
    – JimB
    May 3, 2022 at 20:30

1 Answer 1

1
$\begingroup$

In my opinion, it is not possible in a ListLinePlot. The only solution is with "Epilog"

Regards,....Jos

ListLinePlot[{{2.1, 2.9, 2.8, 1.9}, {2.2, 2.7, 1.1, 2.2}, {2.3, 1.7, 2.3, 1.7}}, PlotMarkers -> {Automatic, 0.05}, Epilog -> {Red, PointSize[0.03], Point[{{2.0, 2.9}}]}]

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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