Skip to content

Instantly share code, notes, and snippets.

@marcelcaraciolo
Created June 18, 2012 15:11
Show Gist options
  • Save marcelcaraciolo/2948842 to your computer and use it in GitHub Desktop.
Save marcelcaraciolo/2948842 to your computer and use it in GitHub Desktop.
exemplo_graphs
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