Skip to content

Commit

Permalink
refs #15: More readable ppc plot.
Browse files Browse the repository at this point in the history
  • Loading branch information
achimnol committed Aug 5, 2015
1 parent a4995b1 commit 94056a0
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions scripts/exprlib/plotting/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
from ..records import PPCRecord, AppThruputRecord
from .utils import find_times_font


def kilo_formatter(val, idx):
q = int(val) // 1000
return str(q) + 'K' if q > 0 else '0'

def plot_ppc(category, records, confname, pktsize, base_path):
now = datetime.now()
timestamp_date = now.strftime('%Y-%m-%d')
Expand Down Expand Up @@ -62,6 +67,9 @@ def plot_ppc(category, records, confname, pktsize, base_path):
box2 = ax_ratio.get_position()
ax_ratio.set_position([box2.x0 - 0.03, box2.y0 + 0.05, box2.width*0.62, box.y0 - box2.y0])

ax_ppc.get_yaxis().set_major_formatter(
matplotlib.ticker.FuncFormatter(kilo_formatter))

ppc_colors = [hex2color('#ff375d'), hex2color('#bf0000')]
ratio_colors = [hex2color('#376bff'), hex2color('#0033bf')]
thr_colors = [hex2color('#d8d8d8'), hex2color('#7f7f7f')]
Expand Down Expand Up @@ -89,9 +97,9 @@ def plot_ppc(category, records, confname, pktsize, base_path):
#for thr in thruput[1:node_id+1]:
# step_thr += np.array(thr)
#ax_perf.step(x_ind, step_thr, color='black', where='mid')
h_pcpu, = ax_ppc.plot(x_ind, ppc_cpu, color=ppc_colors[node_id], lw=0.8)
h_pgpu, = ax_ppc.plot(x_ind, ppc_gpu, color=ppc_colors[node_id], lw=0.8)
h_pest, = ax_ppc.plot(x_ind, ppc_est, color=ppc_colors[node_id], lw=1.6)
h_pcpu, = ax_ppc.plot(x_ind, ppc_cpu, color=ppc_colors[node_id], lw=0.3, alpha=0.72)
h_pgpu, = ax_ppc.plot(x_ind, ppc_gpu, color=ppc_colors[node_id], lw=0.3, alpha=0.72)
h_pest, = ax_ppc.plot(x_ind, ppc_est, color=ppc_colors[node_id], lw=0.8, alpha=0.5)
h_ratio, = ax_ratio.plot(x_ind, offl_ratio, color=ratio_colors[node_id], lw=0.8)
h_pcpu.set_dashes([0.6, 0.6])
h_pgpu.set_dashes([2.4, 0.6])
Expand Down

0 comments on commit 94056a0

Please sign in to comment.