Skip to content

Commit

Permalink
Merge pull request #68 from shortbloke/Fix-delta-temperature-plot
Browse files Browse the repository at this point in the history
Use Zip to subtract two lists,  ambient temperature from the cpu temp
  • Loading branch information
nschloe authored Mar 22, 2020
2 parents 3c0fe51 + 7acb09d commit 9a7fcb6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion stressberry/cli/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ def plot(argv=None):
for k in order[::-1]:
temperature_data = data[k]["temperature"]
if args.delta_t:
temperature_data = [t - data[k]["ambient"] for t in data[k]["temperature"]]
temperature_data = []
zip_object = zip(data[k]["temperature"], data[k]["ambient"])
for data[k]["temperature"], data[k]["ambient"] in zip_object:
temperature_data.append(data[k]["temperature"] - data[k]["ambient"])
ax1.plot(
data[k]["time"], temperature_data, label=data[k]["name"], lw=args.line_width
)
Expand Down

0 comments on commit 9a7fcb6

Please sign in to comment.