Open NiRuff opened 3 years ago
Hi @NiRuff, thank you for letting us know. I think this is a small bug. We'll fix it soon.
Great, thanks a lot!
For all that are interested: I uninstalled my current version of nxviz and then updated it using:
pip uninstall nxviz
pip install git+https://github.com/ericmjl/nxviz.git
When I ran the code like this it worked with drawing the edges with linewidth according to the Graph weights:
g = nv.arc(G, node_color_by="community", group_by="community", edge_lw_by="weight")
@AlirezaTheH: One more question: When having many groups with a lot of nodes the matrixPlot gets barely visible for me Can I change the color scheme or make the black more prominent in the plot? It looks like this e.g.:
@NiRuff while it's technically possible to use edge_lw_by
in a matrix plot, I might suggest doing edge_alpha_by
instead. That might help a bit with the visualization, and it makes a bit more sense in this particular setting. The matrix plot is effectively a dot-matrix kind of plot; edge "width" would correspond to circle radius, but transparency is a better thing.
Perhaps something we should do here is to ensure that the dots actually have a border around them. What do you all think?
Thanks for the reply!
I used two versions ultimately: alpha and lw or just alpha. Unfortunately when having a lot of data the visibility is still poor. Here the edge_alpha_by="weight" example:
Here having edge_alpha_by and edge_lw_by both set to "weight"
Unfortunately both are barely visible so I guess your suggestion might help here.
BTW: Thanks for reacting so fast all the time!
I see what you mean, @NiRuff. Thanks for being patient here :smile:.
The nature of large graphs means that the matrix would be difficult to visualize if you also wanted the transparency/lightness effect scaled by weight. I have a hunch you've hit the limits of what data visualization could do without considering the tradeoffs that need to happen.
The first I'd suggest is using panels of matrix plots rather than a single one. In this case, one plot to show clustering structure w/o showing weights, and another plot to show with weights. Put them side by side and you have a very effective data viz panel.
I believe there are two edge_kwargs that could help here, and you could use either one of them to start with. The first is the edge_alpha_scale kwarg, which lets you multiply the alpha (transparency) value by some scalar number across the board. The other is edge_alpha_bounds, which lets you set an upper-bound and lower-bound for transparency scaling. Those would result in visual inaccuracies but a more easily visualized single panel.
If I were in your shoes, though, I'd still use the first option. They make the data storytelling much easier.
Hi,
I was following along with Eric's scipy 2019 network analysis made simple tutorial and ran into this error message plotting the seventh grader network. Is this a related or new issue? (I saw what NiRuff said above and uninstall and reinstalled nxviz package but no change with the error.)
m = MatrixPlot(G) m.draw()
TypeError Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_19744/2627178271.py in
TypeError: draw() takes 0 positional arguments but 1 was given
Any help is appreciated! thanks!
When I am creating a MatrixPlot or CircosPlot like this everything works fine:
However, I wanted to adjust the edge width and set it by the weight in my weighted graph G. I trid adding the parameter
But got the following error message: data_linewidth() missing 1 required positional argument: 'ref_data'
Is this not implemented yet or am I doing something wrong here?
Also: I would also like to adjust some options regarding opacity for the matrix plot - here I run into similar problems.
Thanks!!
P.S.: From the code:
edge_lw_by
: Edge metdata attribute key to set edge line width.edge_alpha_by
: Edge metdata attribute key to set edge transparency.