Feb-16-2017, 01:38 PM (This post was last modified: Feb-16-2017, 01:41 PM by Felipe. Edited 1 time in total.)

Hi guys,

I wrote a code to make corrections in array data and plot the after/before for that.

Here's my code:

Here's my output. The values for B are plotted in the subplot called "Modulo" and for T in the subplot called "Anomalia". For this example I used the values for "originB" and "originT" equals to zero and for "cte" equal to one:

I wrote a code to make corrections in array data and plot the after/before for that.

Here's my code:

while ctr2 == 'R': cte = float(input('Type the constant: ')) plt.close() originB = B originT = T B = B + cte dx = len(T) for i in range(dx): if T[i] >= 0: print(T[i]) T[i] = T[i] + cte print(T[i]) else: T[i] = T[i] - cte print(T) f, axarr = plt.subplots(2, sharex=True) axarr[0].plot(X,B,'-',X,originB,'--') axarr[0].set_title('Modulo') axarr[1].plot(X,T,'-',X,originT,'--') axarr[1].set_title('Anomalia') plt.show(block=False) ctr2 = input('Type R to remove a constant or E to exit: ')I store the the values before changes in "originB" and "originT" arrays. So I use the value of the constant "cte" to performe the corrections. For the "B" array it's a simple sum, but for the "T" array I need to check the elements to decide if I sum or subtract the value of "cte". When I plot, the graph for "B" it's ok, but for "T" it plots in the same position of the values stored in "originT". Look that I put some prints to check if the values of "T" are changing correctly and they are.

Here's my output. The values for B are plotted in the subplot called "Modulo" and for T in the subplot called "Anomalia". For this example I used the values for "originB" and "originT" equals to zero and for "cte" equal to one:

```
Output:
[img]https://drive.google.com/open?id=0B-HZ-2g-lyoUX19IeG4yR19WQU0[/img]
```

I appreciate the help !!