# Delay evaluation but need to plot [closed]

I've defined a mathematica function that makes a taylor series of a function.

s4a[n_] := Normal[Series[f4a[a], {a, 0, n}]]


But I cannot plot it

Plot[s4a[5], {a,-2,2}]
...
General::stop: Further output of General::ivar will be suppressed during this calculation.


I understand I have a problem like described here: General::ivar is not a valid variable when plotting - what actually causes this and how to avoid it?

But I cannot define

s4a[n_] = Normal[Series[f4a[a], {a, 0, n}]]
Series::serlim: Series order specification n is not a machine-sized integer.


So how do I define a function that makes a series of order $n$ and can be plotted?

Edit:

I guess Plot[Evaluate[s4a[5]],{a,-2,2}] works though. Maybe this is the best solution

• Does Plot[Evaluate[s4a[5]], {a, -2, 2}] give what you expect? – kglr Oct 14 '16 at 19:42
• yes. thank you. i made an edit about that a few seconds before your comment. i guess that would be the simplest solution. what does it do though? "causes expr to be evaluated even if it appears as the argument of a function whose attributes specify that it should be held unevaluated." I thought the problem was that evaluation was occurring too early – bernie Oct 14 '16 at 19:43
• Should probably be a duplicate of this: mathematica.stackexchange.com/q/48980/4999 – Michael E2 Aug 1 '19 at 11:51

Normal[Series[f4a[-2], {-2, 0, n}]]

Plot[s4a[5], {a, -2, 2}, Evaluated -> True]

• I see. Thank you. One counter intuitive thing is that the error message before further output of General::ivar will be suppressed is General::ivar: -1.99992 is not a valid variable. This made me thing that Plot was looking for a symbolic form. – bernie Oct 15 '16 at 15:49