Issue
I have the Following plot:
```forest = sk.ensemble.RandomForestRegressor(n_estimators=250,random_state=0)
forest.fit(X, y)
importances = forest.feature_importances_
std = np.std([tree.feature_importances_ for tree in forest.estimators_],axis=0)
indices = np.argsort(importances)[::-1]
refclasscol=list(df.columns.values)
impor_bars = pd.DataFrame({'Features':refclasscol[0:20],'importance':importances[0:20]})
impor_bars = impor_bars.sort_values('importance',ascending=False).set_index('Features')
plt.rcParams['figure.figsize'] = (10, 5)
impor_bars.plot.bar()```
Which displays this : here
I want to remove borders and make something like this:here
Is it possible?
Solution
Typically, people use
plt.axis('off')
to get plots that look like this:
An alternative is adjusting alpha to have very faint borders
The rationale is that the left and bottom axis have the ticks and labels and thus carry information, while the top and right add no value. This style is inspired by the work of Edward Tufte, who recommends that, rather than repeatedly adding emphasis to important elements in a graphic, you apply de-emphasis to unimportant elements.
Answered By - James_SO
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.