'How to plot box plot in python for a dataframe?

I was plotting a scatter plot with x axis = azimuth and y axis = distance.Now i want to change this plot to a box plot.

The code i used for scatter plot is given below:

RAM = [f"RUT1_Azi_meas_{i}" for i in range(48)]
 
RDM = [f"RUT1_Dist_meas_{i}" for i in range(48)]

new_df.plot(x=RAM,y=RDM,kind='scatter',xlabel= 'RUT1_Azimuth[°]',ylabel= 'RUT1_Distance[m]',xlim = [-60,60],ylim=[3,100],figsize=(10, 8))

The scatter plot is attachedsample scatter plot

Then i tried with plotting a box plot for the same dataframe as below:

new_df.boxplot(by = RDM, column = RAM)

which endup in errors.

How can i make this scatter plot to a box plot?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source