We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When I have very long label names and use x_tick_rotation argument the xtick labels are not aligned with the bar graph
ref: ref: https://scikit-plot.readthedocs.io/en/stable/estimators.html#scikitplot.estimators.plot_feature_importances
from sklearn.datasets import load_iris from sklearn.ensemble import RandomForestClassifier from sklearn.tree import plot_tree # Load the Iris dataset X, y = load_iris(return_X_y=True) # print(f'type(X): {type(X)} X :\n{X}') # print(f'type(y): {type(y)} y : \n{y}') # Train a RandomForestClassifier model = RandomForestClassifier(random_state=42, n_estimators=10) # using 10 trees for simplicity model.fit(X, y) skplt.estimators.plot_feature_importances( model, feature_names=['petal length aaaaaaaaaaaaaaaaa', 'petal width bbbbbbbbbbbbbbbbbbbb', 'sepal length cccccccccccccccccccc', 'sepal width ddddddddddddddd'], x_tick_rotation=45 )
ax.set_xticks(range(len(featureNames)), featureNames, rotation=xTickRotation, ha='right', rotation_mode='anchor')
The text was updated successfully, but these errors were encountered:
No branches or pull requests
When I have very long label names and use x_tick_rotation argument the xtick labels are not aligned with the bar graph
ref: ref: https://scikit-plot.readthedocs.io/en/stable/estimators.html#scikitplot.estimators.plot_feature_importances
proposed fix
The text was updated successfully, but these errors were encountered: