(output_filename, data, size=256)
| 166 | Image.fromarray(data).save(filename, optimize=True, quality=80) |
| 167 | |
| 168 | def plot_heatmap(output_filename, data, size=256): |
| 169 | fig = Figure(figsize=(1, 1), dpi=size) |
| 170 | canvas = FigureCanvas(fig) |
| 171 | gs = gridspec.GridSpec(1, 1, left=0.0, right=1.0, bottom=0.0, top=1.0) |
| 172 | ax = fig.add_subplot(gs[0]) |
| 173 | ax.set_axis_off() |
| 174 | ax.imshow(data, cmap='hot', aspect='equal', interpolation='nearest', |
| 175 | vmin=-1, vmax=1) |
| 176 | canvas.print_figure(output_filename, format='png') |
| 177 | |
| 178 | |
| 179 | def draw_heatmap(output_filename, data, size=256): |
nothing calls this directly
no outgoing calls
no test coverage detected