Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed bug computing extents of mpl SpreadPlot #821

Merged
merged 1 commit into from Aug 18, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 11 additions & 1 deletion holoviews/plotting/mpl/chart.py
Expand Up @@ -174,7 +174,6 @@ class SpreadPlot(AreaPlot):

def __init__(self, element, **params):
super(SpreadPlot, self).__init__(element, **params)
self._extents = None

def get_data(self, element, ranges, style):
xs = element.dimension_values(0)
Expand All @@ -184,6 +183,17 @@ def get_data(self, element, ranges, style):
pos_error = element.dimension_values(pos_idx)
return (xs, mean-neg_error, mean+pos_error), style, {}

def get_extents(self, element, ranges):
vdims = element.vdims
vdim = vdims[0].name
neg_dim = vdims[1].name
pos_dim = vdims[2].name if len(vdims) > 2 else vdims[1].name
neg = np.max(np.abs(ranges[neg_dim]))
pos = np.max(np.abs(ranges[pos_dim]))
ranges[vdim] = (ranges[vdim][0]-neg, ranges[vdim][1]+pos)
return super(AreaPlot, self).get_extents(element, ranges)



class HistogramPlot(ChartPlot):
"""
Expand Down