pip install ggplot python from ggplot import * import pandas as pd data = {'Category': ['A', 'B', 'C', 'D'], 'Value': [4, 7, 2, 8]} df = pd.DataFrame(data) python p = ggplot(aes(x='Category', y='Value'), data=df) p + geom_bar(stat='identity') + theme_minimal() python p + geom_bar(stat='identity', fill='steelblue', color='black', width=0.6) p + geom_bar(stat='identity') + theme_minimal() + xlab('Category') + ylab('Value') p + geom_bar(stat='identity') + theme_minimal() + theme(axis_text_x=element_text(angle=45, hjust=1)) p + geom_bar(stat='identity') + theme_minimal() + theme(legend_position='top')


上一篇:
下一篇:
切换中文