Following what reported here I tried to create a boxplot with an overlayed scatter plot.
but when i run:
In [27]: table1.t_in[table1.duration==6]
Out[27]:
counter
7 308.351304
9 305.354920
14 307.832732
15 332.097405
21 309.711144
22 308.227617
23 317.342377
24 306.140126
25 339.185127
27 336.411869
30 313.287353
Name: t_in, dtype: float64
In [28]: table1.t_in[table1.duration==7]
Out[28]:
counter
10 401.891105
11 384.290236
13 387.516037
17 369.366080
18 383.584934
19 357.466159
20 380.888071
26 399.989748
34 353.118944
Name: t_in, dtype: float64
In [29]: fig,ax=plt.subplots()
...:
...: for i in [6,7]:
...: y = table1.t_in[table1.duration==i]
...: # Add some random "jitter" to the x-axis
...: x = np.random.normal(i, 0.03, size=len(y))
...: ax.plot(x, y, 'r.', alpha=0.5)
...:
...: bp = table1.boxplot(column='t_in',by='duration',grid=False,ax=ax)
and if i skip only the last line i get:
How can I plot like the linked question?