Created
November 21, 2012 12:55
-
-
Save juanpabloaj/4124724 to your computer and use it in GitHub Desktop.
matplotlib pyplot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 2 | |
| 4 | |
| 1.1 | |
| 5 | |
| 10 | |
| 3.2 | |
| 1.4 | |
| 0.2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 0.2 | |
| 1.6 | |
| 1.3 | |
| 3 | |
| 3.4 | |
| 2 | |
| 1.8 | |
| 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python | |
| # -*- coding: utf-8 -*- | |
| import matplotlib.pyplot as plt | |
| def archivo_a_lista(archivo): | |
| lista = [] | |
| for l in archivo.readlines(): | |
| lista.append(float(l)) | |
| return lista | |
| a1 = open('001.txt','r') | |
| a2 = open('002.txt','r') | |
| l1 = archivo_a_lista(a1) | |
| l2 = archivo_a_lista(a2) | |
| l3 = [] | |
| for i in range(len(l1)): | |
| l3.append(abs(l1[i] - l2[i])) | |
| plt.subplot(311) | |
| plt.plot(l1) | |
| plt.subplot(312) | |
| plt.plot(l2) | |
| plt.subplot(313) | |
| plt.plot(l3,'ro') | |
| plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment