20 Jul
2020
20 Jul
'20
9:11 a.m.
Hi Pablo, thanks a lot, it works. Best, Jannis Am 17.07.2020 um 16:17 schrieb pablo.perez.piskunow@gmail.com:
Hi Jannis,
you have to do this by hand, like so
``` fig = plt.figure() ax = fig.add_subplot()
cmap = cm.magma # your cmap site_color = np.ones(len(syst.sites())) # or your colors vmin = 1 vmax = 2 # your color bounds norm = colors.Normalize(vmin=vmin, vmax=vmax) normalized_colors = norm(site_color) # cmap(normalized_colors) return the colors as an RGBA array kwant.plot(syst.finalized(), site_color=cmap(normalized_colors), ax=ax) mappable = cm.ScalarMappable(cmap=cmap, norm=norm); fig.colorbar(mappable); ```
Best, Pablo