# Parts of the plot hiding when plotting discontinuous functions

Here is my code:

x[f_] := 0.03183098861837907 (1/8 Sign[24 - f] + 1/8 Sign[-16 + f] -
1/8 Sign[16 + f] + 1/8 Sign[24 + f]) +
0.0010132118364233778 (-3 π Sign[-48 + f] +
1/16 f π Sign[-48 + f] + 5 π Sign[-40 + f] -
1/8 f π Sign[-40 + f] - 2 π Sign[-32 + f] +
1/16 f π Sign[-32 + f] - π Sign[-8 + f] +
1/8 f π Sign[-8 + f] -
1/4 f π Sign[f] + π Sign[8 + f] +
1/8 f π Sign[8 + f] + 2 π Sign[32 + f] +
1/16 f π Sign[32 + f] - 5 π Sign[40 + f] -
1/8 f π Sign[40 + f] + 3 π Sign[48 + f] +
1/16 f π Sign[48 + f]) +
4.973591971621729*^-6 (-(-72 + f)^2 Sign[-72 + f] +
3 (-64 + f)^2 Sign[-64 + f] -
3 (-56 + f)^2 Sign[-56 + f] + (-48 + f)^2 Sign[-48 + f] -
3 (-32 + f)^2 Sign[-32 + f] + 9 (-24 + f)^2 Sign[-24 + f] -
9 (-16 + f)^2 Sign[-16 + f] + 3 (-8 + f)^2 Sign[-8 + f] -
3 (8 + f)^2 Sign[8 + f] + 9 (16 + f)^2 Sign[16 + f] -
9 (24 + f)^2 Sign[24 + f] +
3 (32 + f)^2 Sign[32 + f] - (48 + f)^2 Sign[48 + f] +
3 (56 + f)^2 Sign[56 + f] -
3 (64 + f)^2 Sign[64 + f] + (72 + f)^2 Sign[72 + f]) +
8.289319952702882*^-8 ((-96 + f)^3 Sign[-96 + f] -
4 (-88 + f)^3 Sign[-88 + f] + 6 (-80 + f)^3 Sign[-80 + f] -
4 (-72 + f)^3 Sign[-72 + f] + (-64 + f)^3 Sign[-64 + f] +
4 (-56 + f)^3 Sign[-56 + f] - 16 (-48 + f)^3 Sign[-48 + f] +
24 (-40 + f)^3 Sign[-40 + f] - 16 (-32 + f)^3 Sign[-32 + f] +
4 (-24 + f)^3 Sign[-24 + f] + 6 (-16 + f)^3 Sign[-16 + f] -
24 (-8 + f)^3 Sign[-8 + f] + 36 f^3 Sign[f] -
24 (8 + f)^3 Sign[8 + f] + 6 (16 + f)^3 Sign[16 + f] +
4 (24 + f)^3 Sign[24 + f] - 16 (32 + f)^3 Sign[32 + f] +
24 (40 + f)^3 Sign[40 + f] - 16 (48 + f)^3 Sign[48 + f] +
4 (56 + f)^3 Sign[56 + f] + (64 + f)^3 Sign[64 + f] -
4 (72 + f)^3 Sign[72 + f] + 6 (80 + f)^3 Sign[80 + f] -
4 (88 + f)^3 Sign[88 + f] + (96 + f)^3 Sign[96 + f]) +
1.0361649940878602*^-9 (-(-120 + f)^4 Sign[-120 + f] +
5 (-112 + f)^4 Sign[-112 + f] - 10 (-104 + f)^4 Sign[-104 + f] +
10 (-96 + f)^4 Sign[-96 + f] - 5 (-88 + f)^4 Sign[-88 + f] -
4 (-80 + f)^4 Sign[-80 + f] + 25 (-72 + f)^4 Sign[-72 + f] -
50 (-64 + f)^4 Sign[-64 + f] + 50 (-56 + f)^4 Sign[-56 + f] -
25 (-48 + f)^4 Sign[-48 + f] - 5 (-40 + f)^4 Sign[-40 + f] +
50 (-32 + f)^4 Sign[-32 + f] - 100 (-24 + f)^4 Sign[-24 + f] +
100 (-16 + f)^4 Sign[-16 + f] - 50 (-8 + f)^4 Sign[-8 + f] +
50 (8 + f)^4 Sign[8 + f] - 100 (16 + f)^4 Sign[16 + f] +
100 (24 + f)^4 Sign[24 + f] - 50 (32 + f)^4 Sign[32 + f] +
5 (40 + f)^4 Sign[40 + f] + 25 (48 + f)^4 Sign[48 + f] -
50 (56 + f)^4 Sign[56 + f] + 50 (64 + f)^4 Sign[64 + f] -
25 (72 + f)^4 Sign[72 + f] + 4 (80 + f)^4 Sign[80 + f] +
5 (88 + f)^4 Sign[88 + f] - 10 (96 + f)^4 Sign[96 + f] +
10 (104 + f)^4 Sign[104 + f] -
5 (112 + f)^4 Sign[112 + f] + (120 + f)^4 Sign[120 + f])
Plot[x[f], {f, -100, 100}, PlotRange -> Full]


However I got this plot:

What is my mistake?

Plot[x[f], {f, -100, 100}, PlotRange -> Full,
ExclusionsStyle -> Directive@{Gray, AbsoluteThickness[4]},
PlotStyle -> {Gray, AbsoluteThickness[4]}, PlotPoints -> 100]


EDIT: This should actually be done with

Plot[x[f], {f, -100, 100}, PlotRange -> Full, Exclusions -> None,
PlotStyle -> {Gray, AbsoluteThickness[4]}]


Try:

Plot[x[f], {f, -100, 100}, PlotRange -> Full, ExclusionsStyle -> Red]

• Thank you so much, I want to have the same color and same size when I use this command Plot[x[f], {f, -100, 100}, PlotRange -> Full, ExclusionsStyle -> Gray,PlotStyle -> AbsoluteThickness[4]] Commented Oct 26, 2016 at 16:18
• @EhsanZakeri I am fairly sure you are just looking for the option Exclusions -> None. Please try this and confirm or refute. Commented Oct 26, 2016 at 16:38
• Thanks Mr.Wizard , it works so fine, Thanks a zillion Commented Oct 26, 2016 at 16:46