How to visualize a graph from DGL's datasets?
The following snippet comes from the tutorial https://cnvrg.io/graph-neural-networks/. How can I visualize a graph from the dataset? Using something like matplotlib if possible.
import dgl
import torch
import torch.nn as nn
import torch.nn.functional as F
import dgl.data
dataset = dgl.data.CoraGraphDataset()
g = dataset[0]


import dgl.data
import matplotlib.pyplot as plt
import networkx as nx

dataset = dgl.data.CoraGraphDataset()
g = dataset[0]
options = {
    'node_color': 'black',
    'node_size': 20,
    'width': 1,
}
G = dgl.to_networkx(g)
plt.figure(figsize=[15,7])
nx.draw(G, **options)

It is a huge graph so you might have to play with the sizes (node, width, figure, etc.).
Here are some useful links:

https://networkx.org/documentation/stable/tutorial.html

https://docs.dgl.ai/en/0.5.x/generated/dgl.to_networkx.html#dgl.to_networkx

https://docs.dgl.ai/en/0.5.x/api/python/dgl.data.html


