Reputation: 2919
I have dataframe as:
I want to create a factorplot using seaborn as shown below:
The data is here.
Note: Sleep time in the sown graph = Back-end Service Delay (ms)
My existing code is shown below, I do not know how to proceed with it. Any help is much appreciated.
def save_multi_columns_categorical_charts(df):
)
# add_chart_details(title, filename)
fig, ax = plt.subplots()
all_columns = df['Throughput (Requests/sec'),'Back-end Service Delay (ms)', 'Concurrent Users','Scenario Name','Message Size (Bytes)']
Upvotes: 0
Views: 881
Reputation: 2919
Basically, what I had to do was use melt:
df_results = df_results.melt(id_vars=['Concurrent Users', col,'Scenario Name','Back-end Service Delay (ms)'],
value_vars=['Throughput (Requests/sec)'])
df_results['new_var'] = df_results[col] + ' - ' + df_results['Scenario Name']
g = sns.factorplot(x="Concurrent Users", y='value',
hue='new_var', col='Back-end Service Delay (ms)',
data=df_results, kind=kind,
size=5, aspect=1, col_wrap=2, legend=False)
Upvotes: 1