Message Boards Message Boards

2 Replies
2 Total Likes
View groups...
Share this post:

Why can't I plot a list of functions that plot fine individually?

Posted 11 years ago
I have a function,
v[t] = E^(t (Quantity[-0.2, 1/("Seconds")])) (Quantity[-49.`, ("Meters")/( "Seconds")]) + t (Quantity[0, ("Meters")/("Seconds")^2]) +Quantity[49, ("Meters")/("Seconds")]

and I want to plot this function in the same plot as the line t = 49.

This works, and plots v[ t] by itself:
Plot[Evaluate[v[t]], {t, Quantity[0, "Seconds"], Quantity[30, "Seconds"]}, PlotRange -> {0, 50}]

But if I add t = 49 to it, like this, than v does not plot and I can only see the line at t = 49:
Plot[{Evaluate[v[t]], 49}, {t, Quantity[0, "Seconds"], Quantity[30, "Seconds"]}, PlotRange -> {0, 50}]

If I take out the 49, like so, I get a blank graph:
Plot[{Evaluate[v[t]]}, {t, Quantity[0, "Seconds"], Quantity[30, "Seconds"]}, PlotRange -> {0, 50}]

So for some reason v[ t] plots fine on its own but not when it is part of a list of functions enclosed by curly braces, even if it is the only function in the list.  What could be the cause of this?  Is there any other way I can get these two functions in the same plot together?
POSTED BY: Frederick Fleitz
2 Replies
Try moving Evaluate outside your list of plot functions.
Plot[Evaluate[{v[t], 49}], {t, Quantity[0, "Seconds"],
  Quantity[30, "Seconds"]}, PlotRange -> {0, 50}]
That solved the problem for me.  Thanks
POSTED BY: Frederick Fleitz
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract