Skip to content

Instantly share code, notes, and snippets.

@goddoe
Created September 10, 2019 06:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save goddoe/54608d5004f424ee131ee5015dae9ccd to your computer and use it in GitHub Desktop.
Save goddoe/54608d5004f424ee131ee5015dae9ccd to your computer and use it in GitHub Desktop.
publish quality graph using matplotlib
plt.rc('font', family='serif')
plt.rc('xtick', labelsize='x-large')
plt.rc('ytick', labelsize='x-large')
# plt.rc('text', usetex=True)
plt.rc('axes', labelsize='x-large')
fig = plt.figure(figsize=(6, 6))
ax = fig.add_subplot(1, 1, 1)
x = np.linspace(1., 8., 30)
x = [0.379344588,
0.289970209,
0.159880834,
0.055610725,
0.038728898,
0.035749752,
0.019860973,
0.006951341,
0.004965243,
0.003972195,
0.002979146,
0.001986097]
ax.bar(range(len(x)),x, color='k', ls='solid')
# ax.plot(x, 20/x, color='0.50', ls='dashed')
ax.set_xlabel('Intents index')
ax.set_ylabel('ratio')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment