diff --git a/edisgo/tools/plots.py b/edisgo/tools/plots.py index 381c7375..3a120778 100644 --- a/edisgo/tools/plots.py +++ b/edisgo/tools/plots.py @@ -6,7 +6,6 @@ from typing import TYPE_CHECKING import matplotlib -import matplotlib.cm as cm import numpy as np import pandas as pd import plotly.graph_objects as go @@ -604,7 +603,7 @@ def nodes_by_costs(buses, grid_expansion_costs, edisgo_obj): bus_sizes, bus_colors = nodes_by_costs( pypsa_plot.buses.index, grid_expansion_costs, edisgo_obj ) - bus_cmap = plt.cm.get_cmap(lines_cmap) + bus_cmap = matplotlib.pyplot.colormaps.get_cmap(lines_cmap) elif node_color == "curtailment": bus_sizes = nodes_curtailment(pypsa_plot.buses.index, curtailment_df) bus_colors = "orangered" @@ -681,7 +680,8 @@ def nodes_by_costs(buses, grid_expansion_costs, edisgo_obj): line_width = pypsa_plot.lines.s_nom * scaling_factor_line_width else: line_width = 2 - cmap = plt.cm.get_cmap(lines_cmap) + cmap = matplotlib.pyplot.colormaps.get_cmap(lines_cmap) + ll = pypsa_plot.plot( line_colors=line_colors, line_cmap=cmap, @@ -888,7 +888,7 @@ def color_map_color( """ norm = matplotlib.colors.Normalize(vmin=vmin, vmax=vmax) if isinstance(cmap_name, str): - cmap = cm.get_cmap(cmap_name) + cmap = matplotlib.pyplot.colormaps.get_cmap(cmap_name) else: cmap = matplotlib.colors.LinearSegmentedColormap.from_list("mycmap", cmap_name) rgb = cmap(norm(abs(value)))[:3]