Skip to content

Commit

Permalink
A number of small plotting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Apr 7, 2017
1 parent ef826b7 commit 5d5945f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
16 changes: 10 additions & 6 deletions holoviews/plotting/bokeh/util.py
Expand Up @@ -27,7 +27,7 @@

from ...core.options import abbreviated_exception
from ...core.overlay import Overlay
from ...core.util import basestring
from ...core.util import basestring, unique_array

from ..util import dim_axis_label

Expand Down Expand Up @@ -567,7 +567,7 @@ def expand_batched_style(style, opts, mapping, nvals):
alias = 'alpha'
else:
alias = None
if opt not in style:
if opt not in style or opt in mapping:
continue
elif opt == alias:
if alias in applied_styles:
Expand Down Expand Up @@ -595,14 +595,18 @@ def expand_batched_style(style, opts, mapping, nvals):
def filter_batched_data(data, mapping):
"""
Iterates over the data and mapping for a ColumnDataSource and
replaces columns with repeating values with scalar
replaces columns with repeating values with a scalar. This is
purely and optimization for scalar types.
"""
for k, v in list(mapping.items()):
if isinstance(v, dict) and 'field' in v:
v = v['field']
elif not isinstance(v, basestring):
continue
values = data[v]
if len(np.unique(values)) == 1:
mapping[k] = values[0]
del data[v]
try:
if len(unique_array(values)) == 1:
mapping[k] = values[0]
del data[v]
except:
pass
2 changes: 1 addition & 1 deletion holoviews/plotting/mpl/element.py
Expand Up @@ -664,7 +664,7 @@ def _norm_kwargs(self, element, ranges, opts, vdim):
opts['vmax'] = clim[1]

# Check whether the colorbar should indicate clipping
values = element.dimension_values(vdim)
values = np.asarray(element.dimension_values(vdim))
if values.dtype.kind not in 'OSUM':
el_min, el_max = np.nanmin(values), np.nanmax(values)
else:
Expand Down

0 comments on commit 5d5945f

Please sign in to comment.