def __create_bar_plot(dataframe):
personality_results, column_names = __get_sorted_personality_traits_and_columns(dataframe)
pyplot.subplots(figsize=(16, 12))
colors = __create_colors_and_legend(column_names)
# Use palette instead of hue in barplot because seaborn renders super thin bars when using hue (seaborn bug)
seaborn.barplot(x=personality_results, y=column_names, orient="h", palette=colors)
pyplot.savefig(__get_file_path('trump-personality-results.png'))
print('Bar plot created with trump personality results! View results in trump-personality-results.png')
pyplot.show()
personality_insights_example.py 文件源码
python
阅读 25
收藏 0
点赞 0
评论 0
评论列表
文章目录