Tune size + output

This commit is contained in:
Julian M. Kunkel 2020-08-18 15:46:05 +01:00
parent 9d85bced57
commit c56403a1e4
2 changed files with 9 additions and 3 deletions

View File

@ -28,6 +28,10 @@ def plot(prefix, header, row):
timeseries = [ [k, x, s] for (s,x) in zip(timeseries, range(1, len(timeseries))) ] timeseries = [ [k, x, s] for (s,x) in zip(timeseries, range(1, len(timeseries))) ]
result.extend(timeseries) result.extend(timeseries)
if len(result) == 0:
print("Empty job! Cannot plot!")
return
data = DataFrame(result, columns=["metrics", "segment", "value"]) data = DataFrame(result, columns=["metrics", "segment", "value"])
groups = data.groupby(["metrics"]) groups = data.groupby(["metrics"])
metrics = DataFrame() metrics = DataFrame()
@ -36,14 +40,16 @@ def plot(prefix, header, row):
metrics[name] = [x[2] for x in group.values] metrics[name] = [x[2] for x in group.values]
labels.append(name) labels.append(name)
ax = metrics.plot(subplots=True, legend=False, sharex=True, grid = True, sharey=True, colormap='jet', marker='.', markersize=10) ax = metrics.plot(subplots=True, legend=False, sharex=True, grid = True, sharey=True, colormap='jet', marker='.', markersize=10, figsize=(8, 2 + 2 * len(labels)))
for (i, l) in zip(range(0, len(labels)), labels): for (i, l) in zip(range(0, len(labels)), labels):
ax[i].set_ylabel(l) ax[i].set_ylabel(l)
pyplot.xlabel("Segment number") pyplot.xlabel("Segment number")
pyplot.savefig(prefix + "timeseries" + jobid + ".png") pyplot.savefig(prefix + "timeseries" + jobid + ".png")
# Plot first 30 minutes # Plot first 30 segments
if len(timeseries) <= 50:
return
ax = metrics.plot(subplots=True, legend=False, sharex=True, grid = True, sharey=True, colormap='jet', marker='.', markersize=10, xlim=(0,30)) ax = metrics.plot(subplots=True, legend=False, sharex=True, grid = True, sharey=True, colormap='jet', marker='.', markersize=10, xlim=(0,30))
for (i, l) in zip(range(0, len(labels)), labels): for (i, l) in zip(range(0, len(labels)), labels):

View File

@ -54,7 +54,7 @@ plotJobs = function(jobs){
# print the job timeline # print the job timeline
r = e[ordered, ] r = e[ordered, ]
for (row in 1:length(jobs)) { for (row in 1:length(jobs)) {
prefix = sprintf("%s-%f-%.0f", level, r[row, "similarity"], row) prefix = sprintf("%s-%f-%.0f-", level, r[row, "similarity"], row)
job = r[row, "jobid"] job = r[row, "jobid"]
system(sprintf("scripts/plot-single-job.py %s %s", job, prefix)) system(sprintf("scripts/plot-single-job.py %s %s", job, prefix))
} }