-6

For example, suppose I want to plot $\sin(x)$ and $x^2 +4 $ as two lines simultaneously in a single figure.

I know Show can do it.

But what if I have 5 lines to plot?

Is there anyway to evade Show? I know in Matlab it is very simple.

S. Kohn
  • 123
  • 1
  • 1
  • 7

1 Answers1

2

Is there anyway to evade Show? I know in Matlab it is very simple

You do not need to use Show, just use Plot with the functions to plot in a list.

 Plot[{Sin[x],x^2+4},{x,- Pi, Pi}]

Mathematica graphics

The problem with this method is that, you need an explicit expression of the function. What if you just have some data?

data1={1,2,3,4,5};
data2={1.3,2.4,4.3,5.2};
ListLinePlot[{data1,data2},Mesh->All]

Mathematica graphics

Nasser
  • 143,286
  • 11
  • 154
  • 359