Giter Site home page Giter Site logo

Comments (6)

ericmjl avatar ericmjl commented on August 24, 2024 1

@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?

from nxviz.

ericmjl avatar ericmjl commented on August 24, 2024 1

I see what you mean, @NiRuff. Thanks for being patient here 😄.

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.

from nxviz.

AlirezaTheH avatar AlirezaTheH commented on August 24, 2024

Hi @NiRuff, thank you for letting us know. I think this is a small bug. We'll fix it soon.

from nxviz.

NiRuff avatar NiRuff commented on August 24, 2024

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.:

grafik

from nxviz.

NiRuff avatar NiRuff commented on August 24, 2024

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:

grafik

Here having edge_alpha_by and edge_lw_by both set to "weight"
grafik

Unfortunately both are barely visible so I guess your suggestion might help here.

BTW: Thanks for reacting so fast all the time!

from nxviz.

steepdescend avatar steepdescend commented on August 24, 2024

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
1 m = MatrixPlot(G)
----> 2 m.draw()

TypeError: draw() takes 0 positional arguments but 1 was given

Any help is appreciated! thanks!

from nxviz.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.