ericmjl / nxviz

Visualization Package for NetworkX
https://ericmjl.github.io/nxviz
MIT License
457 stars 87 forks source link

draw() thakes 0 positional arguments but 1 was given #684

Open aegonwolf opened 2 years ago

aegonwolf commented 2 years ago

Description

Trying to plot a matrix plot

What I Did

Plot a matrix Plot m = nv.MatrixPlot(graph) m.draw() plt.show()

Get a type error from m.draw()

I get the same error with CircosPlot and ArcPlot It draws though

aegonwolf commented 2 years ago

I also think some of the documentation is out of data. MatrixPlot for example is not in plots

abigail-collier commented 2 years ago

I am encountering this same error trying to use .draw() with MatrixPlot, ArcPlot, and CircosPlot. Using nxviz 0.7.4, Python 3.9.

aegonwolf commented 2 years ago

I thought it wouldn't be an issue, but now I figured that because of the error, I can't call a savefig on the plot.

EgnaroJQ commented 1 year ago

Have you find the solution? I am encountering the same problem.

ahmadbh96 commented 1 year ago

Having the same issue. Tested the following code:

import networkx as nx import nxviz as nv import matplotlib.pyplot as plt

G = nx.Graph() G.add_edges_from([(1, 2), (1, 3), (2, 3)])

c = nv.CircosPlot(G)

c.draw()

plt.show()

I got: TypeError Traceback (most recent call last) Cell In[17], line 10 6 G.add_edges_from([(1, 2), (1, 3), (2, 3)]) 8 c = nv.CircosPlot(G) ---> 10 c.draw() 12 plt.show()

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

TRKoundak commented 3 months ago

Try this: assume, as in the case of @ahmadbh96, you have some graph, G, and you want to draw a circos plot. ############################ from nxviz import circos c = circos(G) plt.show() ############################ Notice that c.draw() is never called. I think this will draw your plot and not give any error message.