# Overlaying Two Idential Graphs

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.

• Why not plot the difference of the two functions? Commented Aug 22, 2016 at 1:10

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"}]


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]
]


• 兄弟reputation涨得好猛 :)
– yode
Commented Aug 22, 2016 at 9:34

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}]]}]