Skip to content
Advertisement

How to add specific dots on a box plot created using pandas data frame?

I have a pandas data frame (df) which looks like following:enter image description here I was able to create a box plot and scatter plot separately from the given data frame using the following code:

JavaScript

The results look like this: enter image description here

I want to add the dots from the scatter plot which represent only three rows of the data frame into the boxplot. I was able to recreate this using Excel enter image description here. However, how can I formulate my code to do it using matplotlib in Python?

Advertisement

Answer

If I understand correctly you want this:

JavaScript

enter image description here

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