Skip to content

Commit

Permalink
Merge branch 'master' of github.com:parrt/dtreeviz
Browse files Browse the repository at this point in the history
  • Loading branch information
parrt committed Nov 27, 2022
2 parents 4e79827 + 2f6ad45 commit fb5e175
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions dtreeviz/trees.py
Original file line number Diff line number Diff line change
Expand Up @@ -997,10 +997,6 @@ def _get_bins(overall_range, nbins_):
nbins = nbins if nbins > feature_unique_size else feature_unique_size + 1

overall_feature_range = (np.min(X_train[:, node.feature()]), np.max(X_train[:, node.feature()]))

overall_feature_range_wide = (overall_feature_range[0] - overall_feature_range[0] * .08,
overall_feature_range[1] + overall_feature_range[1] * .05)

ax.set_xlabel(f"{feature_name}", fontsize=label_fontsize, fontname=fontname, color=colors['axis_label'])
ax.spines['top'].set_visible(False)
ax.spines['right'].set_visible(False)
Expand Down Expand Up @@ -1040,6 +1036,10 @@ def _get_bins(overall_range, nbins_):
rect.set_edgecolor(colors['rect_edge'])
ax.set_yticks([0, max([max(h) for h in hist])])

# set an empty space at the beginning and the end of the node visualisation for better clarity
bin_length = bins[1] - bins[0]
overall_feature_range_wide = (bins[0] - 2 * bin_length, bins[len(bins) - 1] + 2 * bin_length)

ax.set_xlim(*overall_feature_range_wide)
ax.set_xticks(overall_feature_range)
ax.tick_params(axis='both', which='major', width=.3, labelcolor=colors['tick_label'], labelsize=ticks_fontsize)
Expand Down

0 comments on commit fb5e175

Please sign in to comment.