- Timestamp:
- Apr 5, 2022, 3:48:25 PM (3 years ago)
- Branches:
- ADT, ast-experimental, enum, master, pthread-emulation, qualifiedEnum
- Children:
- 11a1240
- Parents:
- 0c3aa67
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
benchmark/plot.py
r0c3aa67 rf34f95c 40 40 } 41 41 42 def plot(data, x, y ):42 def plot(data, x, y, out): 43 43 fig, ax = plt.subplots() 44 44 colors = itertools.cycle(['#0095e3','#006cb4','#69df00','#0aa000','#fb0300','#e30002','#fd8f00','#ff7f00','#8f00d6','#4b009a','#ffff00','#b13f00']) … … 67 67 ax.yaxis.set_major_formatter( EngFormatter(unit=field_names[y].unit) ) 68 68 plt.legend(loc='upper left') 69 plt.show() 69 if out: 70 plt.savefig(out) 71 else: 72 plt.show() 70 73 71 74 … … 75 78 parser = parser = argparse.ArgumentParser(description='Python Script to draw R.M.I.T. results') 76 79 parser.add_argument('-f', '--file', nargs='?', type=argparse.FileType('r'), default=sys.stdin) 80 parser.add_argument('-o', '--out', nargs='?', type=str, default=None) 81 parser.add_argument('-y', nargs='?', type=str, default="") 77 82 78 83 try: … … 103 108 fields.add(label) 104 109 105 print(series) 106 print("fields") 107 for f in fields: 108 print("{}".format(f)) 110 if not options.out : 111 print(series) 112 print("fields") 113 for f in fields: 114 print("{}".format(f)) 109 115 110 plot(data, "Number of processors", "ns per ops") 116 if options.y and options.y in field_names.keys(): 117 plot(data, "Number of processors", options.y, options.out) 118 else: 119 if options.y: 120 print("Could not find key '{}', defaulting to 'ns per ops'".format(options.y)) 121 plot(data, "Number of processors", "ns per ops", options.out)
Note: See TracChangeset
for help on using the changeset viewer.