MCPcopy Create free account
hub / github.com/CSAILVision/gandissect / plot_heatmap

Function plot_heatmap

netdissect/aceoptimize.py:168–176  ·  view source on GitHub ↗
(output_filename, data, size=256)

Source from the content-addressed store, hash-verified

166 Image.fromarray(data).save(filename, optimize=True, quality=80)
167
168def 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
179def draw_heatmap(output_filename, data, size=256):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected