Mathematica is throwing error messages when I try to plot what I want. As a minimal working example of this problem, the following code runs fine:
test[x_] := NIntegrate[Sin[x - Pi/2] Exp[-xp^2/2], {xp, -Pi, Pi}]
Plot[test[x], {x, 0, 2 Pi}]
But if I decide to do a polar plot
PolarPlot[test[x], {x, 0, 2 Pi}]
I get the error message: "NIntegrate::inumr: The integrand -E^(-(xp^2/2)) Cos[x] has evaluated to non-numerical values for all sampling points in the region with boundaries {{0,3.14159}}. >>"
but eventually I get the plot I'm looking for. I'm wondering why PolarPlot has difficulty, while Plot does not.
NumericQ:Clear[test]; test[x_?NumericQ] := .... – march Nov 10 '15 at 22:53