0
$\begingroup$

I'm facing a problem with Manipulate here, It just plots a blank xy-axis.

Manipulate[
  Plot[FourierTrigSeries[-x^2 + a x, x, 10], {x, -2 Pi, 2 Pi}], 
  {a, -10, 10}]
$\endgroup$
2
  • 3
    $\begingroup$ You need to add Evaluate[]: Plot[Evaluate[FourierTrigSeries[(* stuff *)], (* stuff *)] $\endgroup$ Oct 1, 2018 at 19:18
  • $\begingroup$ i didn't understand, what does evaluate do in this case? $\endgroup$
    – hcp
    Oct 1, 2018 at 19:23

1 Answer 1

4
$\begingroup$

J.M.'s advice, given in his comment, is one solution. Here is another using the plot option Evaluated. I also add custom x-axis ticks and give the option Appearance -> "Labeled" to the control variable a to make the manipulation more user friendly.

Manipulate[
  Plot[FourierTrigSeries[-x^2 + a x, x, 10], {x, -2 Pi, 2 Pi},
    Ticks -> {Subdivide[-2 Pi, 2 Pi, 8], Automatic},
    Evaluated -> True],
  {a, -10, 10, .2, Appearance -> "Labeled"}]

demo

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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