Skip to content

Instantly share code, notes, and snippets.

@ELC
Created July 11, 2021 04:49
Show Gist options
  • Save ELC/3ef83a985e875eed08f650325714e1f7 to your computer and use it in GitHub Desktop.
Save ELC/3ef83a985e875eed08f650325714e1f7 to your computer and use it in GitHub Desktop.
import matplotlib.pyplot as plt
import numpy as np
# fig = plt.figure()
fig, ax = plt.subplots(figsize=(16,9))
margin = 1
plt.plot(( 64, 64), (0, 1), 'b-')
plt.plot((128, 128), (0, 1), 'b-')
plt.plot((192, 192), (0, 1), 'b-')
plt.xlim([0, 512])
plt.ylim([0, 10])
plt.text( 64 - margin, 1.1, 'start' , horizontalalignment='left', size=22, color=(0.14, 0.51, 0.8), family='Andale Mono')
plt.text(128 - margin, 1.1, 'drop' , horizontalalignment='center', size=30, family='Times New Roman')
plt.text(192 - margin, 1.1, 'tabla solo', horizontalalignment='center', family='SF Mono')
plt.axvline(x=.5, ymin=0, ymax=0.75, linewidth=4, color='r', label='s')
ax.tick_params(axis="y",direction="in", pad=-22)
ax.tick_params(axis="x",direction="in", pad=-15)
# plt.xticks(['dsd', 'dsd'])
# frame1 = plt.gca()
# frame1.axes.get_xaxis().set_ticks(['bh', 'malk'])
# plt.axis('off')
plt.subplots_adjust(left=0, right=1, top=1, bottom=0)
# plt.grid()
# plt.savefig('ux.png', bbox_inches='tight', pad_inches=0)
# plt.savefig('ux.png', bbox_inches='tight')
plt.savefig('ux.png', dpi=100) # 1600 x 900
# plt.show()
# fonts: https://stackoverflow.com/a/18821968/4204843 / use set([f.name for f in matplotlib.font_manager.fontManager.ttflist])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment