Skip to content

Instantly share code, notes, and snippets.

@brentp
Last active August 9, 2016 03:54
Show Gist options
  • Save brentp/5a864279217fca81605ca38216ed4f28 to your computer and use it in GitHub Desktop.
Save brentp/5a864279217fca81605ca38216ed4f28 to your computer and use it in GitHub Desktop.
# 0 or 1 indicates absence/presence of variant
data = [
[0, 1, 0, 1, 0, 1],
[0, 0, 0, 1, 1, 1],
[0, 0, 0, 1, 1, 1],
[0, 0, 0, 1, 1, 1],
[0, 0, 0, 1, 1, 1],
[0, 0, 0, 0, 1, 1],
[0, 0, 0, 0, 0, 0],
[1, 1, 1, 0, 0, 0],
]
from matplotlib import pyplot as plt
fig, ax = plt.subplots()
import numpy as np
alpha = 3 * 1.0 / len(data)
for trace in data:
trace = np.cumsum(trace)
plt.step(range(1, len(trace) + 1), trace, color='k', alpha=alpha, lw=15)
plt.xlabel('copy number')
plt.ylabel('cumulative number of H47R variants')
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment