## How to give a different color?

The raw data is a list of 1400 coordinate points. The data can be reshaped as 5 individual lists of 280 coordinate pairs.

```
Clear[data]
Get["https://pastebin.com/raw/AVFwHkC8", "Data"];
newshape = ArrayReshape[data, {5, 280, 2}];
```

Now `ListPlot[newshape]`

will give a different color to each curve.

### How to superpose the curves *without distortion*?

An approximate way is to shift each curve up or down so its 50th data point, say, lies on the x-axis. Plots at different scales show the 5 shifted curves happen to cross one another at points near x=49.54.

```
shifted = # /. {x_, y_} :> {x, y - #[[50, 2]]} & /@ newshape;
ListPlot[shifted, PlotRange -> All]
ListPlot[shifted, PlotRange -> {{20, 85}, {-1, 1}}]
ListLinePlot[shifted, PlotRange -> {{40, 65}, {-0.025, 0.025}}]
```

The last plot hints at the amount of distortion that would be required to really superimpose the curves throughout the region.

### Sensitivity

As it turns out, choosing the 50th data point of each curve worked fairly well. But what if another index had been used? We can use `Manipulate`

to test other values of the index like this:

```
Manipulate[
shifted = # /. {x_, y_} :> {x, y - #[[ndx, 2]]} & /@ newshape;
GraphicsColumn[{
ListPlot[shifted, PlotRange -> All, ImageSize -> Small],
ListLinePlot[shifted,
PlotRange -> {{40, 65}, {-0.025, 0.025}},
ImageSize -> Small]
}],
{{ndx, Length[shifted[[1]]]/5, ndx}, 1, Length[shifted[[1]]], 1}]
```

We can change the value of the index to see how that affects the overlay of the curves.

### Toward an automated method

It may be possible to use the manipulator on several different datasets to develop a method of choosing the index that determines the amount of the shift. For instance, it may be found that 20th data point is a good choice if the curves are to overlay between x=20 and x=40.

Another strategy may be to shift the curve so that some data point near the middle of the valley between the first two peaks lies on the x-axis.

Combine `PeakDetect`

and `Position`

commands to find the indices for the peaks and take it from there.

### PlotLegends

The questions on this site contain many good examples of using `PlotLegends`

. If you have a some specific case that is not working for you, please post the troublesome code in a new question.