High quality figures in Python with matplotlib and seaborn - bar plots

preview_player
Показать описание
Matplotlib and seaborn are fundamental to making figures in python. Here I show you how to use them to make publication quality figures. These charts contain error bars and have visible overlaid data in the form of a swarmplot.

I show you how to customize matplotlib color, font size, axis, size, and many other parameters that will help you in any python charts, not just barplots.

These figures have the appearance of something you would make in graphpad, but they have greater customizability. This seems like a lot of coding, but it only took a few minutes and you can save this as a function and make future charts in seconds.

Рекомендации по теме
Комментарии
Автор

terrific tutorial I learned a lot in a short while. I've learned how to use kwargs - always wondered what all that was about and I love the trick of looping through the border parameters to set them - never thought about that one before.

WildRover
Автор

You're the MVP of this figure i'm working on!

thej
Автор

I used your code but gave squares different colors based on gender using this line of code: swarm=sns.swarmplot(data=df_final, x='Modality', y='value', hue='variable', dodge=True, s=10, fc=df_final['color'])
. But the problem is that in the legend, the dots' colors are based on hue, not fc. I tried many ways but still have the problem. I would appreciate it a lot if you guide me on how to fix it. Thank you very much.

zhalehmohammadalipour