5
$\begingroup$

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:

enter image description here

What is my mistake?

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

enter image description here


EDIT: This should actually be done with

Plot[x[f], {f, -100, 100}, PlotRange -> Full, Exclusions -> None, 
    PlotStyle -> {Gray, AbsoluteThickness[4]}]
$\endgroup$
2
$\begingroup$

Try:

Plot[x[f], {f, -100, 100}, PlotRange -> Full, ExclusionsStyle -> Red]
$\endgroup$
  • $\begingroup$ 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]] $\endgroup$ – Ehsan Zakeri Oct 26 '16 at 16:18
  • 3
    $\begingroup$ @EhsanZakeri I am fairly sure you are just looking for the option Exclusions -> None. Please try this and confirm or refute. $\endgroup$ – Mr.Wizard Oct 26 '16 at 16:38
  • $\begingroup$ Thanks Mr.Wizard , it works so fine, Thanks a zillion $\endgroup$ – Ehsan Zakeri Oct 26 '16 at 16:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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