Last active
August 9, 2016 03:54
-
-
Save brentp/5a864279217fca81605ca38216ed4f28 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# 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