Skip to content

Commit 33df2f2

Browse files
committed
set options for individual shaded regions
1 parent 8892e94 commit 33df2f2

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

setup.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
setup(
44
name='simpleplotlib',
55
packages=['simpleplotlib'],
6-
version='0.16',
6+
version='0.17',
77
description='A matplotlib wrapper focused on beauty and simplicity',
88
author='Matthew K. Mukerjee',
99
author_email='[email protected]',
1010
url='https://github.com/mukerjee/simpleplotlib',
11-
download_url='https://github.com/mukerjee/simpleplotlib/tarball/0.16',
11+
download_url='https://github.com/mukerjee/simpleplotlib/tarball/0.17',
1212
license='MIT License',
1313
keywords=['matplotlib', 'plots', 'beauty', 'simplicity'],
1414
classifiers=[

simpleplotlib/__init__.py

+13-5
Original file line numberDiff line numberDiff line change
@@ -465,17 +465,25 @@ def plot(x, y, my_options={}, y2=None):
465465
axes[0].axvline(l, **options.vertical_lines.options.toDict())
466466

467467
if options.vertical_shaded.limits:
468-
for l, r in options.vertical_shaded.limits:
469-
axes[0].axvspan(l, r, **options.vertical_shaded.options.toDict())
468+
for vs in options.vertical_shaded.limits:
469+
l, r = vs[:2]
470+
o = options.vertical_shaded.options.toDict()
471+
if len(vs) > 2:
472+
o = vs[2].toDict()
473+
axes[0].axvspan(l, r, **o)
470474

471475
if options.horizontal_lines.lines:
472476
for l in options.horizontal_lines.lines:
473477
axes[0].axhline(l, **options.horizontal_lines.options.toDict())
474478

475479
if options.horizontal_shaded.limits:
476-
for l, r in options.horizontal_shaded.limits:
477-
axes[0].axhspan(l, r, **options.horizontal_shaded.options.toDict())
478-
480+
for hs in options.horizontal_shaded.limits:
481+
l, r = hs[:2]
482+
o = options.horizontal_shaded.options.toDict()
483+
if len(hs) > 2:
484+
o = hs[2].toDict()
485+
axes[0].axhspan(l, r, **o)
486+
479487
for i in xrange(len(options.text.labels)):
480488
axes[-1].text(*options.text.positions[i], s=options.text.labels[i],
481489
transform=axes[0].transAxes,

0 commit comments

Comments
 (0)