Python Forum

Full Version: sns point plot grouping
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,
I have data contain two tools, three groups, my x-axis ID, y-axis is Time. I want to plot as follows:


data:

ID	      Group	      Tool	  Time
LK0P1	  Group1	  ToolA	  20
LK0P1	  Group2	  ToolA	  15
LK0P1	  Group3	  ToolA	  53
MMK9	  Group1	  ToolA	  45
MMK9	  Group2	  ToolA	  16
MMK9	  Group3	  ToolA	  42
TY90	  Group1	  ToolA	  36
TY90	  Group2	  ToolA	  19
AVBF	  Group1	  ToolB	  20
AVBF	  Group2	  ToolB	  15
AVBF	  Group3	  ToolB	  53
MMK9	  Group1	  ToolB	  45
MMK9	  Group2	  ToolB	  16
MMK9	  Group3	  ToolB	  42
TY90	  Group1	  ToolB	  36
TY90	  Group2	  ToolB	  19
1. Row1&col1 ToolA(Group1) x-axis: ID, y-axis:Time
1. Row1&col2 ToolB(Group1) x-axis: ID, y-axis:Time
3. Row2&col1 ToolA(Group2) x-axis: ID, y-axis:Time
4. Row2&col2 ToolB(Group2) x-axis: ID, y-axis:Time
5. Row3&col1 ToolA(Group3) x-axis: ID, y-axis:Time
5. Row3&col2 ToolB(Group3) x-axis: ID, y-axis:Time

I use below code, but it is not plotting any thing,



#%%
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
sns.set(style="ticks", color_codes=True)
     
     
attend = pd.read_excel(r'D:\subplots2.xlsx')
g = sns.FacetGrid(attend, col="Tool", col_wrap=4, ylim=(0, 10))
g.map(sns.pointplot, "ID", "Time", order=[1, 2, 3], color=".3", ci=None);