How to increase the space between bar plot bars

Try replace plt.bar(range(len(my_dict)), my_dict.values(), align=’center’) with plt.figure(figsize=(20, 3)) # width:20, height:3 plt.bar(range(len(my_dict)), my_dict.values(), align=’edge’, width=0.3) The option align=’edge’ will eliminate white space on the left of the bar chart. And width=0.3 sets the bars’ width smaller size than the default value. The bars spacing will be adjusted accordingly. For the labels along x-axis, they should … Read more

Change bar color according to hue name

A. using a list of colors The easiest solution to make sure to have the same colors for the same categories in both plots would be to manually specify the colors at plot creation. # First bar plot ax = sns.barplot(data=a, x=’Scenario’, y=’Duration’, hue=”Program”, ci=None, palette=[“C0”, “C1”, “k”]) # … # Second bar plot ax2 … Read more

Barchart with vertical ytick labels

Do you mean something like this: >>> from matplotlib import * >>> plot(xrange(10)) >>> yticks(xrange(10), rotation=’vertical’) ? In general, to show any text in matplotlib with a vertical orientation, you can add the keyword rotation=’vertical’. For further options, you can look at help(matplotlib.pyplot.text) The yticks function plots the ticks on the y axis; I am … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)