Skip to content

Commit

Permalink
add dotted lines to np plots
Browse files Browse the repository at this point in the history
  • Loading branch information
cspollard committed Apr 1, 2020
1 parent 71d9d0e commit 32b4b91
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion ext/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,8 @@
map(list, zip(*sorted(zip(npbinnames, npbiny, npbinmed,
npbinerr, npbinmederr))))

binsx = range(0, len(npbinnames))
nbins = len(npbinnames)
binsx = range(0, nbins)

ax = plt.subplots()[1]
ax.set_xticks([-1] + binsx + [len(binsx)])
Expand All @@ -218,6 +219,16 @@
plt.errorbar(binsx, npbiny, xerr=0.5, fmt='o')
plt.errorbar(binsx, npbinmed, yerr=zip(*npbinmederr), color="red",
fmt='o')

plt.plot([0, nbins], [-1, -1], color='gray', lw=2,
linestyle="dashed", alpha=0.5)

plt.plot([0, nbins], [0, 0], color='gray', lw=2,
linestyle="dashed", alpha=0.5)

plt.plot([0, nbins], [1, 1], color='gray', lw=2,
linestyle="dashed", alpha=0.5)

plt.tight_layout()
plt.savefig("npbin.pdf")
plt.clf()
Expand Down

0 comments on commit 32b4b91

Please sign in to comment.