Skip to content

Commit

Permalink
Use default discrete=False for hist2d (consistent with hexbin)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukelbd committed Aug 28, 2021
1 parent c36cf10 commit 267dd16
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions proplot/axes/plot.py
Expand Up @@ -2364,9 +2364,9 @@ def _parse_color(self, x, y, c, *, apply_cycle=True, **kwargs):
kwargs = self._parse_cycle(**kwargs)
methods = (self._parse_cmap, self._parse_levels, self._parse_autolev, self._parse_vlim) # noqa: E501
else:
kwargs['line_plot'] = True
kwargs['default_discrete'] = False
kwargs = self._parse_cmap(x, y, c, **kwargs)
kwargs = self._parse_cmap(
x, y, c, line_plot=True, default_discrete=False, **kwargs
)
methods = (self._parse_cycle,)
pop = _pop_params(kwargs, *methods, ignore_internal=True)
if pop:
Expand Down Expand Up @@ -2675,9 +2675,9 @@ def _parse_levels(
if ticks is not None and np.iterable(ticks):
_guide_kw_to_arg('colorbar', kwargs, locator=ticks)

# Filter the resulting level boundaries
# Filter the level boundaries
if levels is not None and np.iterable(levels):
if nozero and 0 in levels:
if nozero:
levels = levels[levels != 0]
if positive:
levels = levels[levels >= 0]
Expand Down Expand Up @@ -2857,10 +2857,9 @@ def _parse_cmap(
levels = None # unused
if discrete:
levels, kwargs = self._parse_levels(
*args, vmin=vmin, vmax=vmax, norm=norm, norm_kw=norm_kw,
extend=extend, skip_autolev=skip_autolev, **kwargs
*args, vmin=vmin, vmax=vmax, norm=norm, norm_kw=norm_kw, extend=extend, skip_autolev=skip_autolev, **kwargs # noqa: E501
)
elif not skip_autolev:
if not discrete and not skip_autolev:
vmin, vmax, kwargs = self._parse_vlim(
*args, vmin=vmin, vmax=vmax, **kwargs
)
Expand Down Expand Up @@ -4237,7 +4236,7 @@ def hist2d(self, x, y, bins, **kwargs):
# Rely on pcolormesh() override for this.
if bins is not None:
kwargs['bins'] = bins
return super().hist2d(x, y, **kwargs)
return super().hist2d(x, y, default_discrete=False, **kwargs)

# WARNING: breaking change from native 'C'
@_preprocess_data('x', 'y', 'weights')
Expand Down

0 comments on commit 267dd16

Please sign in to comment.