def test_plot_parameters_plot(topology_parameters_list, labels, colors): """ Test plotting parameters. """ figs, axes = parameters.plot_parameters_plot(topology_parameters_list, labels, colors) assert all(isinstance(fig, Figure) for fig in figs) assert all(isinstance(ax, Axes) for ax in axes) plt.close("all")
def plot_parameters( self, label: Optional[str] = None, color: Optional[str] = None) -> Optional[Tuple[Figure, Axes]]: """ Plot geometric and topological parameters. """ if label is None: label = self.name if color is None: color = "black" assert self.parameters is not None figs, axes = plot_parameters_plot( topology_parameters_list=[self.parameters], # type: ignore labels=[label], colors=[color], ) return figs[0], axes[0]
# %% # Compare KB11 and KB7 Networks b22 = "Dimensionless Intensity B22" cpb = "Connections per Branch" selected = {b22, cpb} # Filter to only selected parameters kb11_network_selected_params = { param: value for param, value in kb11_parameters.items() if param in selected } kb7_network_selected_params = { param: value for param, value in kb7_parameters.items() if param in selected } # Compare parameters figs, axes = plot_parameters_plot( topology_parameters_list=[ kb11_network_selected_params, kb7_network_selected_params, ], labels=["KB11", "KB7"], colors=["red", "blue"], ) plt.show()