Hi Elias,
yes, that's a pain point. I use the following, but it's not great:
import matplotlib.colors as mcolors
import matplotlib.pyplot as plt
fig, ax = ...
cmap= plt.cm.OrRd
norm = mcolors.Normalize(vmin=0, vmax=100)
sm = plt.cm.ScalarMappable(cmap=cmap, norm=norm)
sm.set_array([])
colors = list(map(mcolors.to_hex, cmap(norm(line_loading))))
n.plot(ax=ax, line_colors=colors, ...)
plt.colorbar(sm, orientation='vertical', shrink=0.7, ax=ax, label=...)
Best wishes,
Fabian N
> --
> You received this message because you are subscribed to the Google
> Groups "pypsa" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
pypsa+un...@googlegroups.com
> <mailto:
pypsa+un...@googlegroups.com>.
> To view this discussion on the web, visit
>
https://groups.google.com/d/msgid/pypsa/731c2804-9ed6-438c-873f-f0aa03d91a5bn%40googlegroups.com
> <
https://groups.google.com/d/msgid/pypsa/731c2804-9ed6-438c-873f-f0aa03d91a5bn%40googlegroups.com?utm_medium=email&utm_source=footer>.
--
Dr.-Ing.
Fabian Neumann (he/him)
Postdoctoral Researcher
Department of Digital Transformation in Energy Systems
Institute of Energy Technology
Technische Universität Berlin
Group website:
https://tub-ensys.github.io
Personal website:
https://neumann.fyi
Zoom:
https://tu-berlin.zoom.us/my/fneum
Schedule Meeting:
https://calendly.com/fneum
Visitor Address:
Einsteinufer 25 (TA 8)
10587 Berlin
My working hours may not be your working hours. Do not feel pressure to
reply to this email outside your working hours.