Skip to content

Commit

Permalink
Merge pull request #21 from jakirkham/use_axes_facecolor
Browse files Browse the repository at this point in the history
Use facecolor with axes
  • Loading branch information
jakirkham committed Dec 7, 2017
2 parents 174edca + 2e12437 commit e1583d5
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion mplview/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
__date__ = "$Nov 01, 2016 9:19$"


import distutils

import numpy

import matplotlib
Expand Down Expand Up @@ -234,8 +236,15 @@ def __init__(self,

self.next_cid = 0

mpl_ver = distutils.version.LooseVersion(matplotlib.__version__)
mpl_2_ver = distutils.version.LooseVersion("2")

fig_axes_kwargs = {}
axcolor_name = "facecolor" if mpl_ver >= mpl_2_ver else "axisbg"
fig_axes_kwargs[axcolor_name] = self.axcolor

self.axtime = fig.add_axes(
[0.25, 0.1, 0.65, 0.03], axisbg=self.axcolor
[0.25, 0.1, 0.65, 0.03], **fig_axes_kwargs
)
self.stime = matplotlib.widgets.Slider(
self.axtime,
Expand Down

0 comments on commit e1583d5

Please sign in to comment.