I am trying to plot some data so get statistics about it, but matplotlib simply can't plot it as boxplots. I tried with histograms and it workd well:

histograms of ten parameters grouped in to groups

But when i change the code to plot boxplots it just doesnt work:

boxplots of the same data before with some of the plots in blank

I know that the y axis is in the wrong place, but I even searched on where it should be (for example SAQRS in the range of -150 to 50) but even there there is nothing. The plotting code is below:

fig, axs = plt.subplots(2, 5)
axs = axs.flatten()
for ax, colm, colf in zip(axs, masc, fem):

I tried in MATLAB to see if the problem is in the dataset and the plots worked perfectly, but i need to do it in python because of some operations i have to do (i am not good at matlab to do so)

  • $\begingroup$ Have you tried plotting just one dataset at a time? e.g. just masc or fem? Did it work this time? $\endgroup$
    – Miss.Alpha
    Commented Oct 13, 2022 at 10:28

2 Answers 2


I know this question is old but I encountered the same problem and in case it helps anyone else: I found that there were nulls in my data that was being passed to the both the histograms and whisker plots. It seems the histogram can handle the nulls whereas the whisker plot can't. So the solution is data cleaning!


I also encountered the same problem. I found a workaround with pandas. Please see: https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.boxplot.html

  • 1
    $\begingroup$ While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review $\endgroup$
    – Ethan
    Commented Oct 13, 2022 at 16:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.