

Voila! This looks so much better than the rainbow graph above. The list of 954 colors looks like this: Īn example where the color can be changed is as follows: barplot = plt.bar(y_pos, odds_number, color = 'darkgreen', alpha = 0.85) t_color('darkred') plt.xlabel('Factors', fontsize = 15, weight = 'bold') Below we will learn simple tricks to change the color of your bars.įirst let us have a look what colors can be called by name: import matplotlib for name, hex in (): colorname.append(name) colorid.append(hex)Īnd to see them in a list zippedcolors = list(zip(colorname, colorid)) zippedcolors = sorted(zippedcolors, key=lambda x: x)

Often times, if you want one bar to stand out, changing its color to a sharper contrast helps make it stand out. You can set the style of your plot (this is a global setting - will apply to all cells in your jupyter notebook) by the following syntax: e('seaborn-poster') #sets the size of the charts e('ggplot')Ĭhanging the color of your bars makes a big difference in visualization. An easy way to look at what is available is by this code import matplotlib.style as style style.available style.available This is one of the easiest ways of changing the look and feel of your graphs. We will dive below into some of the easy customizations that can be done to improve the way your graphs look. But there are some low hanging fruits that can help improve the look & feel of your graphs immediately. Visualizations take months of practice to nail down.

A big part of being a good data scientist is having the ability to convey your point using relevant and beautiful graphs and visualizations.
