Kind of as an extension of this question: How to plot a series using different colors depending on the y-value
Is there something similar to MeshFunction or ColorFunction that can control whether a curve being plotted is dashed vs solid depending on the y-value?


– Hanmyo Feb 06 '15 at 08:45data = RandomReal[{-3, 3}, 100]; ListLinePlot[data, MeshFunctions -> {Abs[#2] &}, Mesh -> {{1}}, MeshShading -> {Blue, Directive[Red, Dashed]}, MeshStyle -> None]Abs[#2]&. I don't know why; maybe a bug? Meanwhile, a work-around is to useListLinePlot[data, MeshFunctions -> {#2 &}, Mesh -> {{-1, 1}}, MeshShading -> {Blue, Directive[Red, Dashed]}, MeshStyle -> None]. Btw, thank you for the accept. – kglr Feb 06 '15 at 13:27Abs. – Hanmyo Feb 06 '15 at 20:34