Skip to content
Snippets Groups Projects
Commit 7441bd04 authored by Sören Henning's avatar Sören Henning
Browse files

Simplify plot creation

parent 2eeaaa5a
No related branches found
No related tags found
No related merge requests found
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` ```
import os import os
import requests
from datetime import datetime, timedelta, timezone
import pandas as pd import pandas as pd
from functools import reduce
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
``` ```
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` ```
exp_id = 1025
warmup_sec = 60
warmup_partitions_sec = 120
threshold = 2000 #slope
directory = '../results-inst' directory = '../results-inst'
experiments = {
'exp1003': 'exp1003',
'exp1025': 'exp1025',
}
``` ```
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` ```
df1 = pd.read_csv(os.path.join(directory, 'exp1025_min-suitable-instances.csv')).set_index('dim_value').rename(columns={"instances": "1025"}) dataframes = [pd.read_csv(os.path.join(directory, f'{v}_min-suitable-instances.csv')).set_index('dim_value').rename(columns={"instances": k}) for k, v in experiments.items()]
df2 = pd.read_csv(os.path.join(directory, 'exp1003_min-suitable-instances.csv')).set_index('dim_value').rename(columns={"instances": "1003"})
#df1.join(df2, on='instances') df = reduce(lambda df1,df2: df1.join(df2,how='outer'), dataframes)
df = df1.join(df2, how='outer')
df df
``` ```
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` ```
plt.style.use('ggplot') plt.style.use('ggplot')
plt.rcParams['axes.facecolor']='w' plt.rcParams['axes.facecolor']='w'
plt.rcParams['axes.edgecolor']='555555' plt.rcParams['axes.edgecolor']='555555'
#plt.rcParams['ytick.color']='black' #plt.rcParams['ytick.color']='black'
plt.rcParams['grid.color']='dddddd' plt.rcParams['grid.color']='dddddd'
plt.rcParams['axes.spines.top']='false' plt.rcParams['axes.spines.top']='false'
plt.rcParams['axes.spines.right']='false' plt.rcParams['axes.spines.right']='false'
plt.rcParams['legend.frameon']='true' plt.rcParams['legend.frameon']='true'
plt.rcParams['legend.framealpha']='1' plt.rcParams['legend.framealpha']='1'
plt.rcParams['legend.edgecolor']='1' plt.rcParams['legend.edgecolor']='1'
plt.rcParams['legend.borderpad']='1' plt.rcParams['legend.borderpad']='1'
plt.figure() plt.figure()
ax = df.plot(kind='line', marker='o') ax = df.plot(kind='line', marker='o')
#ax = df.plot(kind='line',x='dim_value', legend=False, use_index=True) #ax = df.plot(kind='line',x='dim_value', legend=False, use_index=True)
ax.set_ylabel('instances') ax.set_ylabel('instances')
ax.set_xlabel('data sources') ax.set_xlabel('data sources')
ax.set_ylim(ymin=0) ax.set_ylim(ymin=0)
#ax.set_xlim(xmin=0) #ax.set_xlim(xmin=0)
``` ```
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` ```
``` ```
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment