# How to evaluate open intervals in ContourPlot?

I want to ContourPlot an expression over an interval that excludes some points. Since i dont know how to do it I wrote

ContourPlot[{((1 - Tanh[X])/(1 + Tanh[X]))^-k == (k + Tanh[X])/(k - Tanh[X]),((1 - Tanh[X])/(1 + Tanh[X]))^-k == -((k + Tanh[X])/(k - Tanh[X]))}, {X, -0.1, 5}, {k, -Sqrt[(3/2)], Sqrt[3/2]},PlotRange -> {{0, 5},Full}, FrameLabel -> {"\!$$\*FractionBox[\(\*SubscriptBox[\(m$$,$$\\[Phi]$$] L\), SqrtBox[$$2$$]]\)", "k"},ContourStyle -> {Red, Blue}, PlotLegends -> {"+sign", "-sign"}]


and obtained

But I want to plot for $$0 and $$-\sqrt{3/2}\leq k<-1\cup -1.

So, what I expect is the exclusion of the horizontal lines corresponding to $$k=(-1,0,1)$$.

• Use the option "Exclusions" Dec 19, 2022 at 18:15

Use the Exclusions option:
ContourPlot[{
FrameLabel->{"\!$$\*FractionBox[\(\*SubscriptBox[\(m$$,$$\\[Phi]$$] L\), SqrtBox[$$2$$]]\)","k"},ContourStyle->{Red,Blue},PlotLegends->{"+sign","-sign"},

Note that I also had to exclude k==Tanh[X].