Why does
t = 2 Pi;
Plot[D[Sin[x],x], {x,0,t}] (* Plotting the derivative of Sin[x] *)
not work, but
t = 2 Pi;
Plot[Evaluate[D[Sin[x],x], {x,0,t}] (* Plotting the evaluation of the derivative of Sin[x]? *)
do? And why does this work, but neither
t = 2 Pi;
Plot[{D[Sin[x],x]}, {x,0,t}] (* Plotting the one-length array of the derivative of Sin[x] *)
nor
t = 2 Pi;
Plot[{Evaluate[D[Sin[x],x]]}, {x,0,t}] (* Plotting the one-length array of the evaluation of the derivative of Sin[x]? *)
works?
t
, but to answer the question, it is because one of the attributes of thePlot
function isHoldAll
. The relevant documentation has an example withPlot
that explains in more detail $\endgroup$