Skip to content

Commit

Permalink
ENH: Improve color support in errorplots
Browse files Browse the repository at this point in the history
  • Loading branch information
jluttine committed May 4, 2016
1 parent 7bbf6e8 commit cbec0c2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion bayespy/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
from scipy import special
import matplotlib.pyplot as plt
from matplotlib import animation
from matplotlib import colors
#from matplotlib.pyplot import *

from bayespy.inference.vmp.nodes.categorical import CategoricalMoments
Expand Down Expand Up @@ -1239,7 +1240,7 @@ def contourplot(x1, x2, y, colorbar=False, filled=True, axes=None):


def errorplot(y=None, error=None, x=None, lower=None, upper=None,
color=(0,0,0,1), fillcolor=(0,0,0,0.4), axes=None, **kwargs):
color=(0,0,0,1), fillcolor=None, axes=None, **kwargs):

if axes is None:
axes = plt.gca()
Expand All @@ -1264,6 +1265,9 @@ def errorplot(y=None, error=None, x=None, lower=None, upper=None,
if (lower is not None) and (upper is not None):
l = y - lower
u = y + upper
if fillcolor is None:
color = colors.ColorConverter().to_rgba(color)
fillcolor = tuple(color[:3]) + (0.2 * color[3],)
axes.fill_between(x,
l,
u,
Expand Down

0 comments on commit cbec0c2

Please sign in to comment.