Commit 1e76e630 authored by ulrich_y's avatar ulrich_y
Browse files

Added option for dashed errorband plots

parent 4b7acb70
......@@ -57,7 +57,7 @@ def watermark(fig, txt='PRELIMINARY', fontsize=60, rotation=20):
)
def errorband(p, ax=None, col='default', underflow=False, overflow=False):
def errorband(p, ax=None, col='default', underflow=False, overflow=False, linestyle='solid'):
"""
errorband(p, ...) plots an errorband of a compatible histogram p.
......@@ -95,17 +95,18 @@ def errorband(p, ax=None, col='default', underflow=False, overflow=False):
p[-1,0] = p[-2,0] + (s+0.5) * delta
if col == 'default':
artist = ax.step(p[:,0], p[:,1], where='mid')
artist = ax.step(p[:,0], p[:,1], where='mid', linestyle=linestyle)
col = artist[0].get_color()
else:
artist = ax.step(p[:,0], p[:,1], col, where='mid')
ax.fill_between(
p[:,0],
p[:,1]+p[:,2]/2, p[:,1]-p[:,2]/2,
step='mid',
facecolor=col, edgecolor=col
)
artist = ax.step(p[:,0], p[:,1], col, where='mid', linestyle=linestyle)
if linestyle == 'solid':
ax.fill_between(
p[:,0],
p[:,1]+p[:,2]/2, p[:,1]-p[:,2]/2,
step='mid',
facecolor=col, edgecolor=col
)
return artist
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment