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

Problem with labels, trying integration with pandas, Latex and Networkx #271

Open
atheuxM opened this issue Jan 12, 2024 · 0 comments
Open

Comments

@atheuxM
Copy link

atheuxM commented Jan 12, 2024

Well, I can create a graph using pandas and networkx which the Labels in Latex work fine. But when I tried a better visualization with pyvis does not work well.

from pyvis.network import Network
import networkx as nx
import pandas as pd
import matplotlib.pyplot as plt
net = Network(notebook=True)

#For test proporse
relacion = [{"Word_1": "$a^2$", "Word_2": "$b$"}]
relacion_df = pd.DataFrame(relacion)

G = nx.from_pandas_edgelist(relacion_df,
source = "Word_1",
target = "Word_2",
create_using = nx.Graph())

plt.figure(figsize=(18,8))
pos = nx.kamada_kawai_layout(G)
nx.draw(G, with_labels=True, node_color='skyblue', edge_cmap=plt.cm.Blues, pos = pos, font_size = 12)
plt.show()
net.from_nx(G)
net.show("Teste_1.html")

image

image

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

1 participant