Skip to content
Advertisement

Plot multiple boxplot in one graph in pandas or matplotlib?

I have a two boxplotes

JavaScript

But I want to place them in one graph to compare them. Have you any advice to solve this problem? Thanks!

Advertisement

Answer

Use return_type='axes' to get a1.boxplot to return a matplotlib Axes object. Then pass that axes to the second call to boxplot using ax=ax. This will cause both boxplots to be drawn on the same axes.

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement