MCPcopy Create free account
hub / github.com/NVlabs/AutoDMP / plot

Function plot

dreamplace/ops/density_potential/density_potential.py:309–347  ·  view source on GitHub ↗

density map contour and heat map

(plot_count, density_map, padding, name)

Source from the content-addressed store, hash-verified

307
308
309def plot(plot_count, density_map, padding, name):
310 """
311 density map contour and heat map
312 """
313 density_map = density_map[padding:-1 - padding, padding:-1 - padding]
314 print("max density = %g" % (np.amax(density_map)))
315 print("mean density = %g" % (np.mean(density_map)))
316
317 fig = plt.figure()
318 ax = fig.gca(projection='3d')
319
320 x = np.arange(density_map.shape[0])
321 y = np.arange(density_map.shape[1])
322
323 x, y = np.meshgrid(x, y)
324 ax.plot_surface(x, y, density_map, alpha=0.8)
325
326 ax.set_xlabel('x')
327 ax.set_ylabel('y')
328 ax.set_zlabel('density')
329
330 #plt.tight_layout()
331 plt.savefig(name + ".3d.%d.png" % (plot_count))
332 plt.close()
333
334 #plt.clf()
335
336 #fig, ax = plt.subplots()
337
338 #ax.pcolor(density_map)
339
340 ## Loop over data dimensions and create text annotations.
341 ##for i in range(density_map.shape[0]):
342 ## for j in range(density_map.shape[1]):
343 ## text = ax.text(j, i, density_map[i, j],
344 ## ha="center", va="center", color="w")
345 #fig.tight_layout()
346 #plt.savefig(name+".2d.%d.png" % (plot_count))
347 #plt.close()

Callers

nothing calls this directly

Calls 1

printFunction · 0.50

Tested by

no test coverage detected