Skip to content

Commit

Permalink
[plots1d] mask zero-counts in logscale feature histogram
Browse files Browse the repository at this point in the history
  • Loading branch information
thempel committed Jul 11, 2018
1 parent 53ff74d commit 24a9a61
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pyemma/plots/plots1d.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ def plot_feature_histograms(xyzall,
if not ylog:
y = hist / hist.max()
else:
y = _np.log(hist) / _np.log(hist).max()
y = _np.zeros_like(hist) + _np.NaN
pos_idx = hist > 0
y[pos_idx] = _np.log(hist[pos_idx]) / _np.log(hist[pos_idx]).max()
ax.fill_between(edges[:-1], y + h + hist_offset, y2=h + hist_offset, **kwargs)
ax.axhline(y=h + hist_offset, xmin=0, xmax=1, color='k', linewidth=.2)
ax.set_ylim(hist_offset, h + hist_offset + 1)
Expand Down

0 comments on commit 24a9a61

Please sign in to comment.