Mary A. Marion
Mary A. Marion

Reputation: 800

How to plot functions and combine into one graph in Mathematica using a Table[Plot[ approach?

Here is an attempt to plot 2-c Exp[-t] for c=-3 to 3 by 1 in Mathematica.

Table[Plot[2 - c  Exp[-t], {t, 0, 1}], {c, -3, 3}]

I want these 7 plots to be combined into one image. The following gives an error message.

Show[{%, %%, %%%, %%%%, %%%%%, %%%%%%, %%%%%%%}]

How to do? Another approach?

Upvotes: 1

Views: 2208

Answers (1)

b3m2a1
b3m2a1

Reputation: 158

There are many ways to do this. As the most basic case, this will work:

Show[
 Table[Plot[2 - c Exp[-t], {t, 0, 1}], {c, -3, 3}],
 PlotRange -> All
 ]

enter image description here

But here's a cleaner one:

Plot[Evaluate@Table[2 - c Exp[-t], {c, -3, 3}], {t, 0, 1}]

enter image description here

Upvotes: 2

Related Questions