Is there a simple way to differentiate multiple lines with sparse markers?

Hi, I have a multiple-line plot like this
微信截图_20240607111736
The figure is ugly owing to the unnecessary markers for each data point. How can I differentiate the two lines with less markers?

Which plotting package are you using? The simplest solution would be to superpose

  • a line plot with all the points
  • a scatter plot with a subset of the points (like every fourth one)

Hi, gdalle, I am using Plots with Plots.GRBackend(). I tried to use “scatter” inspired by your suggestion, but superfluous legends will show like this:
微信截图_20240607111736
It is much like what I desire except for the superfluous legend

you can remove the labels for the two scatter plots, and ideally make them have the same color as the lines?

I think I’ve got my problem solved by following the code like this:

p = plot(…; label = nothing)
scatter!(p…)
It now outputs like this
微信截图_20240607111736

Sure, but you could also provide label = nothing on the other two curves.

That is cool! The codes are more concise !