Skip to main content
edited tags
Link
halmir
  • 16.2k
  • 38
  • 59
Became Hot Network Question
Source Link
user444
  • 2.8k
  • 2
  • 8
  • 32

How to use both solid and dashed line in a single curve

I want to edit this code from the wolfram Documentation Center so that, the red curve comes as dashed lines and the black comes in solid. How to do that using ColorFunction?

Colour a curve red when its absolute coordinate is above 0:

Plot[ Sinc[x], {x, 0, 10}, ColorFunction -> Function[{x, y}, If[y > 0, Red, Black]], ColorFunctionScaling -> False, PlotStyle -> Thick] 

enter image description here