Created
March 30, 2016 21:40
-
-
Save kewitz/7a07e325e3f5d7f22ed0771d35ca9f53 to your computer and use it in GitHub Desktop.
IEEE oriented plotting for spyder
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
figsize = (3.5, 3.5) | |
#plt.style.use('grayscale') | |
plt.rc('font', size = 10, **{'family':'serif','serif':['Times New Roman']}) | |
plt.rc('text', usetex=True) | |
plt.rc('legend', fancybox=True) | |
colors = plt.rcParams['axes.color_cycle'] | |
def lines(x, ys, labels, filename): | |
series = len(ys) | |
xlabels = x; | |
x = arange(len(dof)) | |
xdelta = abs(x[-1]-x[0]) | |
f, ax = plt.subplots(figsize=figsize) | |
for i, y in enumerate(ys): | |
ax.plot(x, y, ':.', alpha=.5, ms=15, label=labels[i], linewidth=2) | |
ax.spines['right'].set_visible(False) | |
ax.spines['top'].set_visible(False) | |
ax.spines['bottom'].set_visible(False) | |
ax.spines['left'].set_visible(False) | |
plt.xlim(x[0]-xdelta*.1, x[-1]+xdelta*.1) | |
plt.ylabel(u"Speed-up") | |
plt.xlabel(u"Graus de Liberdade") | |
plt.legend(loc=0) | |
plt.xticks(x, ["%i" % a for a in dof]) | |
plt.grid(axis='y') | |
f.savefig(filename) | |
lines(x, [y1, y2, y3], ["Label 1", "Label 2", "Label 3"], "graphname.pdf") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment