[feature request] adding a logarithmic colormap normalization to drawing methods #7438
RiccardoBasilone
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
Thanks for the feedback and suggestion. I think you should be able to provide edge_color directly to get the transformation you want. If you set up the colors using color_normal = mpl.colors.LogNorm(vmin=edge_vmin, vmax=edge_vmax)
ecolor = [edge_cmap(color_normal(e)) for e in edge_color]
nx.draw_networkx_edges(G, pos=pos, edge_color=ecolor) |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi there,
I've been using networkx for a few months now and i find it works very well.
I was wondering if it would be possible to implement colormaps that aren't mpl.colors.Normalize into the drawing methods. Sometimes it's useful to plot node or edge attributes normalized logarithmically, but from what i see in the documentation for draw_networkx_edges, you can pass a color map but can't choose the type of normalization.
In the source code for draw_networkx_edges i see that there is a line
color_normal = mpl.colors.Normalize(vmin=edge_vmin, vmax=edge_vmax)
maybe making this a parameter in calling the function one could choose any of the normalizations supported by matplotlib, such as LogNorm?
Thanks for your consideration.
Beta Was this translation helpful? Give feedback.
All reactions