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

Error importing and executing Circosplot. #687

Open
hypowergravity opened this issue May 31, 2022 · 1 comment
Open

Error importing and executing Circosplot. #687

hypowergravity opened this issue May 31, 2022 · 1 comment

Comments

@hypowergravity
Copy link

hypowergravity commented May 31, 2022

  • nxviz version: nxviz-0.7.4
  • Python version: Python 3.9.6
  • Operating System: Ubuntu 20.10

Description

I was trying to import the CircosPlot method and plot the graph.

What I Did

Input
-> from nxviz.plots import CircosPlot
Output
ImportError: cannot import name 'CircosPlot' from 'nxviz.plots' (/media/hp/software/conda/envs/amber/lib/python3.9/site-packages/nxviz/plots.py)

Next I tried to import the Circos plot using import nxviz as nv
When I tried to add more argument I am not able to plot the Circos plot.
The input comment I used is

import nxviz as nv

c = nv.CircosPlot(graph=g,figsize=(13, 13),node_grouping="class", node_color="class",
               edge_width="weight",node_labels=True)
c.draw()
Error :
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
Input In [47], in <cell line: 1>()
----> 1 c = nv.CircosPlot(G,node_grouping="class", node_color="class",edge_width="weight",node_labels=True)
      2 c.draw()

File /media/hp/software/conda/envs/amber/lib/python3.9/site-packages/nxviz/api.py:337, in CircosPlot.__init__(self, G, **kwargs)
    335 def __init__(self, G, **kwargs):
    336     super().__init__()
--> 337     func_kwargs = {object_to_functional[k]: v for k, v in kwargs.items()}
    338     self.fig = plt.figure()
    339     self.ax = circos(G, **func_kwargs)

File /media/hp/software/conda/envs/amber/lib/python3.9/site-packages/nxviz/api.py:337, in <dictcomp>(.0)
    335 def __init__(self, G, **kwargs):
    336     super().__init__()
--> 337     func_kwargs = {object_to_functional[k]: v for k, v in kwargs.items()}
    338     self.fig = plt.figure()
    339     self.ax = circos(G, **func_kwargs)

KeyError: 'node_labels'

I was trying to replicate the given tutorial page .
Kindly please guide.
Thank you

Sriram.

@phage-GP
Copy link

phage-GP commented Jan 6, 2023

you can try this

import nxviz as nv

nv.circos(g)

https://ericmjl.github.io/nxviz/api/high-level-api/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants