Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have an InterpolatingFunction that I'd like to plot, and I wonder why I have to perform a ReplaceAll on the following function:

Plot[Evaluate[IIz[r, t] /. soln] /. t -> 5, {r, 0, 490}, PlotRange -> {{0, 
 490}, {.000015, -.00035}}, AxesLabel -> Automatic]`

soln is the solution to a differential diffusion equation given by Mathematica (v. 9.0.1) as


When I plot the 3D solution, there is no problem in using

Plot3D[Evaluate[IIz[r, t] /. soln], {r, 0, 490}, {t, 0, 10}, 
 PlotRange -> 
 {{0, 490}, {0, 10}, {.000015, -.00035}}, 
 AxesLabel -> Automatic] 

and I would think that all I'd need to do to plot this in terms of a fixed t would be to replace t with a constant like so:

Plot[Evaluate[IIz[r, 5] /. soln] , {r, 0, 490}, 
 PlotRange -> {{0, 490}, 
 {.000015, -.00035}}, AxesLabel -> Automatic]`

However, when I input that, I get a blank plot… What gives?

For the original differential equation, see this question.

share|improve this question
up vote 3 down vote accepted

It will work as you expect if you get the solution in a form like

IIz ->InterpolatingFunction[...

and not like

IIz[r,t] -> ...

since in the second case you have to have the explicit t, not 5, in order for the match to succeed.

share|improve this answer
I didn't even realize that specification was unnecessary… Thank you for the clarification, and as you, say, it works perfectly. Is there any advantage to getting the solution in the original form rather than IIz[r,t]? – Dustin Wheeler May 24 '13 at 21:26

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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