From 04fbce7f577e56bc0e34b6a32e343266f7cfaa50 Mon Sep 17 00:00:00 2001 From: Paul Brodersen Date: Wed, 22 Nov 2023 11:14:49 +0000 Subject: [PATCH] Raise a warning if the node edge color dominates (issue #77) --- netgraph/_main.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/netgraph/_main.py b/netgraph/_main.py index 56584fa..af10d43 100755 --- a/netgraph/_main.py +++ b/netgraph/_main.py @@ -297,6 +297,13 @@ def __init__(self, edges, edge_alpha = self._normalize_numeric_argument(edge_alpha, self.edges, 'edge_alpha') edge_zorder = self._normalize_numeric_argument(edge_zorder, self.edges, 'edge_zorder') + for node in self.nodes: + if (node_size[node] < node_edge_width[node]) & (node_color[node] != node_edge_color[node]): + msg = f"The border around the node {node} is broader than its radius." + msg += f" The node will mostly have the color of the border ({node_edge_color[node]}), even though a different face color was specified ({node_color[node]})." + msg += f" To address this issue, reduce the value given for `node_edge_width`." + warnings.warn(msg) + # Rescale. node_size = self._rescale(node_size, BASE_SCALE) node_edge_width = self._rescale(node_edge_width, BASE_SCALE)