Panda boxplot but not displaying the box

Is there a way to use boxes but only show dots?

I have it:

import seaborn as sns
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt

data2 = pd.DataFrame(dict(site85_574C=[10,20,30,40, 50], site41_366A=[5,15, 25, 35, 45]),  columns=["site85_574C", "site41_366A"])
data2.boxplot(widths=0.05)
plt.scatter(np.repeat(np.arange(data2.shape[1])+1, data2.shape[0]), data2.values.ravel(), marker='+', alpha=1.0)

      

but I only want to see points in vertex lines, not field and mustache

enter image description here

+3


source to share


1 answer


data2.boxplot(widths=0.05,  showbox=False, whiskerprops={'lw': 0})

      

Note. showbox

and whiskerprops

are kwds

boxplot, which in turn are passed to matplotlib.boxplot

.

Link



http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.boxplot.html

http://matplotlib.org/api/pyplot_api.html

+2


source







All Articles