Skip to content

Commit

Permalink
Fixed clashing variable naming
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Apr 29, 2019
1 parent 474fa2b commit 74a8889
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions holoviews/plotting/mpl/chart.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,8 +333,8 @@ def initialize_plot(self, ranges=None):

# Get plot ranges and values
dims = hist.dimensions()[:2]
edges, hvals, widths, lims, isdatetime = self._process_hist(hist)
if isdatetime and not dims[0].value_format:
edges, hvals, widths, lims, is_datetime = self._process_hist(hist)
if is_datetime 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 @@ -381,14 +381,13 @@ def _process_hist(self, hist):
hist_vals = np.array(values)
xlim = hist.range(0)
ylim = hist.range(1)
isdatetime = False
if isdatetime(edges):
is_datetime = isdatetime(edges)
if is_datetime:
edges = np.array([dt64_to_dt(e) if isinstance(e, np.datetime64) else e for e in edges])
edges = date2num(edges)
xlim = tuple(dt_to_int(v, 'D') for v in xlim)
isdatetime = True
widths = np.diff(edges)
return edges[:-1], hist_vals, widths, xlim+ylim, isdatetime
return edges[:-1], hist_vals, widths, xlim+ylim, is_datetime


def _compute_ticks(self, element, edges, widths, lims):
Expand Down

0 comments on commit 74a8889

Please sign in to comment.