Better Plotly Bar Chart

·1 min readbookclubvisualizationplotlystorytellingreading

I'm reading "storytelling with data" by Cole Nussbaumer Knaflic. I plan to write my thoughts and insights from the book once I finish it. For now, I wanted to play with it a bit and create a better bar chart visualization that -

  1. Highlight the category you find most important and assign a special color to it (i.e prominent_color in the code), while the remaining categories used the same color (i.e. latent_color)
  2. Remove grids and make the background and paper colors the same to remove cognitive load.
Bar chart styled after 'Storytelling with Data': the key category highlighted in orange, the rest in grey, no gridlines

The implementation is flexible, so if you feel like changing one of the settings(i.e., show the grid lines or center the title) you can pass it via keyword arguments when calling the function.


https://gist.github.com/tomron/dffae6ca7c679094894159b26b1d4d6f