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

The manipulate function in Mathematica allows the users to adjust the values of the parameters in a graphical way. How do I plot multiple functions in a same graph and also I can use manipulate at the same time?

   Plot[f1(x+n)], {x, 
     0.0001, 1}, PlotRange -> {-10, 10}],
   Plot[f2(x+n)], {x, 
     0.0001, 1}, PlotRange -> {-10, 10}]}],
   {n, 1, 10}]

with give two independent plots with single curve in each. How should I do multiple curve in a same plot?

share|improve this question

migrated from Jul 16 '14 at 15:49

This question came from our site for professional and enthusiast programmers.

Like this?

f1[x_] := x^2;
f2[x_] := x^4;
 Plot[{f1[x + n], f2[x + n]}, {x, 0.0001, 1}, PlotRange->{-10, 10}],
 {n, 1, 10}]

The documentation for Plot shows an example of doing exactly this on the second line. Plot

share|improve this answer
and how to indicate which is which? – user3222184 Jul 14 '14 at 1:22
You could try adding ,PlotLegends->LineLegend["Expressions"] after your PlotRange, but I tend to see the more you have to fiddle with your plot to make it look like you think it must the more grief you will have. And I don't even try to help with that. – Bill Jul 14 '14 at 7:45

Using Bill's answer but adding Epilog[] for labeling, try

f1[x_] := x^2;
f2[x_] := x^4;
 Plot[{f1[x + n], f2[x + n]}, {x, 0.0001, 1}, 
  PlotStyle -> {Red, Blue}, PlotRange -> {-10, 10}, Epilog -> {
      Style["f1", FontFamily -> "Times New Roman", FontSize -> 10, 
       Red], {.6, f1[n + .6] + .6}]),
      Style["f2", FontFamily -> "Times New Roman", FontSize -> 10, 
       Blue], {.6, f2[n + .6] + .6}])
    }], {n, 1, 10}]

enter image description here

share|improve this answer

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.