Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

viz: node_fc_cmap does not work if node_fc is not a NodeStat #389

Closed
maximelucas opened this issue Jun 7, 2023 · 3 comments · Fixed by #402
Closed

viz: node_fc_cmap does not work if node_fc is not a NodeStat #389

maximelucas opened this issue Jun 7, 2023 · 3 comments · Fixed by #402
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@maximelucas
Copy link
Collaborator

maximelucas commented Jun 7, 2023

Let's say we plot a simple hypergraph

edges = [[1, 2], [1, 2, 3], [2, 3], [3, 4, 5, 6]]
H = xgi.Hypergraph(edges)

# plot node size ~ degree, with shades of green
xgi.draw(H, node_fc=H.nodes.degree, node_fc_cmap=mpl.colormaps["Greens"])

Here H.nodes.degree is a NodeStat, it works:
Screenshot 2023-06-07 at 12 01 21

But if we replace it by a list with the same values H.nodes.degree.aslist(), the cmap is discarded and back to its default:
Screenshot 2023-06-07 at 12 04 05

I guess we may have a similar problem with related variables: node_ec_cmap, dyad_color_cmap, edge_fc_cmap.

@maximelucas maximelucas added bug Something isn't working good first issue Good for newcomers labels Jun 7, 2023
@nwlandry
Copy link
Collaborator

nwlandry commented Jun 14, 2023

PR #402 fixes this, but I need to figure out why it breaks the unit tests for drawing. It passes the tests for the _color_arg_to_dict just fine, but for some reason it isn't getting the number of patches correct. I did verify that the visualization looks correct.

@nwlandry
Copy link
Collaborator

Any ideas, @thomasrobiglio or @maximelucas?

@thomasrobiglio
Copy link
Collaborator

see #402 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants