Skip to content

Instantly share code, notes, and snippets.

@conniec
Last active December 17, 2015 19:19
Show Gist options
  • Save conniec/5659503 to your computer and use it in GitHub Desktop.
Save conniec/5659503 to your computer and use it in GitHub Desktop.
import matplotlib.pyplot as plt
fig = plt.figure()
ax = fig.add_subplot(1,1,1)
log = [51.45,
68.35,
77.9,
85,
85.15,
84,
84.85,
84.6,
84.1,
84.2,
84.2]
p1, = ax.plot([50.05,
59.35,
69.4,
79.4,
83.65,
83.85,
83.6,
82.1,
82.35,
82.8,
82.55], 'bo-')
p2, = ax.plot([57.75,
65.2,
76.35,
82.55,
85.5,
85.35,
84.6,
84.4,
84.7,
84.8,
84.4], 'ro-')
plt.ylabel('Accuracy in percent')
plt.xlabel('Regularization param C')
#locs, labels = xticks()
labels = ['1e-7', '1e-6', '1e-5', '1e-4', '1e-3', '1e-2', '0.1', '1', '10', '100', '1000']
#xlabel(labels)
#ax = fig.add_subplot(111)
p3, = ax.plot(log, 'go-')
ax.legend([p1, p2, p3], ['Untransformed', 'Binary', 'Log'], loc=4)
ax.set_ylim(0,100)
ax.set_xlim(-1,12)
#ax.set_xticks([0,1,2,3,4,5,6,7,8,9,10,11])
ax.grid(color="gray", linestyle="dashed")
ax.set_xticklabels(labels)
#ax.set_xlabel(labels)
#xticks(locs, labels)
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment