# How to distinguish plots which are very close to each other?

I have plotted 3 graphs which are very close to each other. For example, assume I want to display three functions $$\sin(x)$$, $$\sin(x)+0.0001$$ and $$\sin(x)+0.0002$$ together.

plot1 = Plot[Sin[x], {x, -2 Pi, 2 Pi}, PlotStyle -> Blue,
AxesLabel -> {"x", "sin(x)"}, PlotLabel -> "Plot of sin(x)"];
plot2 = Plot[Sin[x] + 0.0001, {x, -2 Pi, 2 Pi}, PlotStyle -> Red,
AxesLabel -> {"x", "sin(x)"}, PlotLabel -> "Plot of sin(x)"];
plot3 = Plot[Sin[x] + 0.0002, {x, -2 Pi, 2 Pi}, PlotStyle -> Green,
AxesLabel -> {"x", "sin(x)"}, PlotLabel -> "Plot of sin(x)"];
Show[
{plot1, plot2, plot3},
PlotLabel -> Style["Plots", Black, 13, Bold] ]


The output is the following image. No matter how much I zoom into it they are indistinguishable.

I'm wondering if it is possible to make these graphs distinguishable in Mathematica. For example is it possible to do something like the following image,

• Normally, one plots just one function and differences to it. Dec 22, 2023 at 17:43
• To echo @yarchik if you have two aspects of data or a function you want to emphasize, you need two figures despite what some journal editors want.
– JimB
Dec 22, 2023 at 18:01
• The usual approach is to plot the differences $\{f_1(x)-f_2(x),f_1(x)-f_3(x)\}$. Dec 22, 2023 at 20:20

### PlotHighlighting

curves[x_] := {Sin[x], Sin[x] + 0.0001, Sin[x] + 0.0002};

plotHighlighting = {
{"Dropline", <|"Style" -> AbsolutePointSize[12]|>},
{"XYLabel", <|Appearance -> None,
LabelingFunction -> (Module[{xx = ToExpression @ First @ #},
Plot[Evaluate @ curves @ x, {x, xx - Pi/10000, xx + Pi/10000},
ImageSize -> 100,
PlotRange -> {{xx - Pi/10000, xx + Pi/10000}, All},
Axes -> False, PlotStyle -> {Blue, Red, Green}]] &)|>}};

Plot[Evaluate @ curves @ x, {x, -2 Pi, 2 Pi},
PlotStyle -> MapThread[{Opacity[1], AbsoluteThickness[#], #2} &,
{{3, 3, 1}, {Blue, Red, Green}}], AxesLabel -> {"x", "sin(x)"},
ImageSize -> Large,
PlotHighlighting -> plotHighlighting,
PlotLabel -> "Plot of sin(x)"]


To get a variation on Ulrich's approach, use

Plot[Evaluate @ curves @ x, {x, -2 Pi, 2 Pi},
PlotStyle ->
{{{}, {10, 10}, {10, 20}}, {Blue, Red, Green}}],
AxesLabel -> {"x", "sin(x)"},
ImageSize -> Large,
PlotHighlighting -> plotHighlighting,
PlotLabel -> "Plot of sin(x)"]


• Maybe subgraph.
Clear[subgraph];
subgraph[t_] :=
Plot[{Sin[x], Sin[x] + 0.0001, Sin[x] + 0.0002}, {x, -2 Pi, 2 Pi},
Axes -> None,
PlotRange -> ({{t - .001, t + .001}, {Sin[t] - .001,
Sin[t] + .001}})];
Manipulate[
Plot[{Sin[x], Sin[x] + 0.0001, Sin[x] + 0.0002}, {x, -2 Pi, 2 Pi},
PlotStyle -> {{Thickness[.01], Blue}, {Thickness[.01],
Red}, {Thickness[.01], Green}}, AxesLabel -> {"x", "sin(x)"},
PlotLabel -> "Plot of sin(x)",
Epilog -> {Inset[subgraph[t], {5, .5}, Automatic, 3],
Arrow[{{t, Sin[t]}, {5, .5}}]}], {t, -2 π, 2 π}]


• I like this very much! Dec 22, 2023 at 16:03
• @cvgmt Ok now you're just showing off :P :-) Dec 23, 2023 at 15:40

The difference between the curves is much smaller than the thickness of each curve! If you want to distinguish these curves, then each curve would have to be about 100 times thinner. In that case, they will be too thin to see!

Doesn't seem like what you want, but you could subtract $$\sin x$$ from each curve.

Or, just like in the example you show, you could zoom in to a smaller range.

 Show[{plot1, plot2, plot3}, PlotRange -> {{-.005, .01}, {0, .01}},
PlotLabel -> Style["Plots", Black, 13, Bold], Frame -> True,Axes->False]


Perhaps something like

Plot[{Sin[x], Sin[x] + 0.0001, Sin[x] + 0.0002}, {x, -2 Pi, 2 Pi},
PlotStyle -> {{ Thickness[.01], Blue}, {Thickness[.01], Dashed,
Red}, {Thickness[.01], Dotted, Green}},
AxesLabel -> {"x", "sin(x)"}, PlotLabel -> "Plot of sin(x)"]


You could use ListPlot with appropriate PlotMarkers

a = Table[Sin[x], {x, -2 Pi, 2 Pi, Pi/8}];
b = a + 0.0001;
c = a + 0.0002;

ListPlot[{a, b, c},
Joined -> {True, False, False},
PlotMarkers ->
{Style["\[EmptyCircle]", 22, Red],
Style["\[EmptyCircle]", 14, Darker@Green],
Style[\[FilledCircle], 6, Blue]},
PlotLegends -> Automatic,