Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from matplotlib import pyplot as plt
- fractions = range(1, 16)
- mcgs = [0,0,0,0,0,190,145,10,0,0,0,0,0,0,0]
- dpms = [0,0,0,0,0,290,390,0,0,0,0,5,20,80,350]
- #check lists for length
- for list in [dpms, mcgs]:
- assert len(list) == len(fractions), "lists should be same length"
- fig, ax1 = plt.subplots(figsize=(6,4))
- ax2 = ax1.twinx()
- def my_plot(ax, fractions, alist, color = "red", ylabel = "ylabel"):
- ax.scatter(fractions, alist, color=color, label=ylabel, alpha=0.5)
- ax.plot(fractions, alist, color=color, ls=":")
- ax.set_ylabel(ylabel)
- my_plot(ax1,
- fractions,
- dpms,
- ylabel=r"Total Radioactivity count (DPM) $10^{3}$",
- color="orange")
- my_plot(ax2,
- fractions,
- mcgs,
- ylabel= r"Total Protein $\mu$g",
- color="blue")
- fig.legend(bbox_to_anchor=(1, 1), loc='upper left', borderaxespad=0.)
- ax1.set_title(r"Incorporation of ${}^{14}$C into X")
- ax1.set_ylim(0, 450)
- ax2.set_ylim(0, 200)
- ax1.set_xlabel("fraction")
- fig.tight_layout()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement