Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to plot a 1D graph with two curves that identically overlap. For example, trivially consider

Plot[Sin[x], {x, 0, 3}]

What are the best options to use to plot two overlapping $\sin$ cuves (in the same domain) such that the graphs are (to some extent) visually distinguishable so that the reader can say -- yes, these two plots are the same (for more interesting cases, though).

Thanks.

share|improve this question
3  
Why not plot the difference of the two functions? – march 8 hours ago

For any curves that might overlap even just a little:

Plot[{Sin[x], Sin[x]}, {x, 0, 3}, 
 PlotStyle -> {{Thickness[0.03], LightGray}, Red},
 PlotLegends -> {"Curve 1", "Curve 2"}]

Two identical curves

share|improve this answer

Use a combination of Show with MeshStyle and/or PlotStyle

Show[
 Plot[Sin[x], {x, 0, Pi}, Mesh -> 20, 
  MeshStyle -> Directive[PointSize[0.02], Red], 
  PlotStyle -> Directive[Thickness[0.01], Red], MaxRecursion -> 0],
 Plot[Cos[x - Pi/2], {x, 0, Pi}, Mesh -> 20, 
  MeshStyle -> Directive[PointSize[0.01], Blue], 
  PlotStyle -> Directive[Thickness[0.0025], Blue], MaxRecursion -> 0]
 ]

enter image description here

share|improve this answer
    
兄弟reputation涨得好猛 :) – yode 42 secs ago

Using Epilog directly.

Plot[Sin[x], {x, 0, 3}, 
     PlotStyle -> {Blue, Opacity[0.5]}, 
     Epilog -> {Dashed, Red, Line[Table[{t, Sin[t]}, {t, 0, 3, 0.1}]]}]

enter image description here

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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