Skip to content

Commit

Permalink
Better variable naming
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed May 26, 2018
1 parent 43dbd0c commit c3a2be0
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions holoviews/plotting/mpl/chart.py
Expand Up @@ -261,8 +261,8 @@ def initialize_plot(self, ranges=None):

# Get plot ranges and values
dims = hist.dimensions()[:2]
edges, hvals, widths, lims, datetime = self._process_hist(hist)
if datetime and not dims[0].value_format:
edges, hvals, widths, lims, isdatetime = self._process_hist(hist)
if isdatetime and not dims[0].value_format:
dt_format = Dimension.type_formatters[np.datetime64]
dims[0] = dims[0](value_format=DateFormatter(dt_format))

Expand Down Expand Up @@ -297,13 +297,13 @@ def _process_hist(self, hist):
hist_vals = np.array(values)
xlim = hist.range(0)
ylim = hist.range(1)
datetime = False
isdatetime = False
if edges.dtype.kind == 'M' or isinstance(edges[0], datetime_types):
edges = date2num([v.tolist() if isinstance(v, np.datetime64) else v for v in edges])
xlim = date2num([v.tolist() if isinstance(v, np.datetime64) else v for v in xlim])
datetime = True
isdatetime = True
widths = np.diff(edges)
return edges[:-1], hist_vals, widths, xlim+ylim, datetime
return edges[:-1], hist_vals, widths, xlim+ylim, isdatetime


def _compute_ticks(self, element, edges, widths, lims):
Expand Down Expand Up @@ -370,7 +370,7 @@ def _update_artists(self, key, hist, edges, hvals, widths, lims, ranges):

def update_handles(self, key, axis, element, ranges, style):
# Process values, axes and style
edges, hvals, widths, lims, datetime = self._process_hist(element)
edges, hvals, widths, lims, _ = self._process_hist(element)

ticks = self._compute_ticks(element, edges, widths, lims)
ax_settings = self._process_axsettings(element, lims, ticks)
Expand All @@ -394,12 +394,12 @@ def _process_hist(self, hist):
"""
Subclassed to offset histogram by defined amount.
"""
edges, hvals, widths, lims, datetime = super(SideHistogramPlot, self)._process_hist(hist)
edges, hvals, widths, lims, isdatetime = super(SideHistogramPlot, self)._process_hist(hist)
offset = self.offset * lims[3]
hvals *= 1-self.offset
hvals += offset
lims = lims[0:3] + (lims[3] + offset,)
return edges, hvals, widths, lims, datetime
return edges, hvals, widths, lims, isdatetime


def _update_artists(self, n, element, edges, hvals, widths, lims, ranges):
Expand Down

0 comments on commit c3a2be0

Please sign in to comment.