Created
June 18, 2012 15:11
-
-
Save marcelcaraciolo/2948842 to your computer and use it in GitHub Desktop.
exemplo_graphs
This file contains 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
import matplotlib | |
import matplotlib.pyplot as plt | |
import numpy as np | |
import pylab | |
from matplotlib.ticker import MaxNLocator | |
def plot_graphs(dataP, id_listP, titleP, labelsP, | |
dataR, id_listR, titleR, labelsR, | |
dataF, id_listF, titleF, labelsF, filesave=None): | |
colors_list = ["g", "b", "r", "k", "m", "y"] | |
index = 0 | |
pylab.figure() | |
ax1 = pylab.subplot(131) | |
for it_out in dataP: | |
x = [] | |
y = [] | |
for it in it_out: | |
x.append(it[0]) | |
y.append(it[1]) | |
ax1.plot(x, y, colors_list[index], | |
label="%s" % (id_listP[index],), linewidth=1.0) | |
index += 1 | |
ax1.xaxis.set_major_locator(MaxNLocator(steps=[5,10,15])) | |
pylab.xlabel(labelsP[0]) | |
pylab.ylabel(labelsP[1]) | |
pylab.legend(prop=FontProperties(size="smaller")) | |
pylab.title(titleP) | |
pylab.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment