.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/datasets/plot_cora.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_datasets_plot_cora.py: Cora Citation Network ===================== Hello world .. GENERATED FROM PYTHON SOURCE LINES 8-13 .. code-block:: default import networkx as nx import matplotlib.pyplot as plt from etudes.datasets.networks import load_dataset .. GENERATED FROM PYTHON SOURCE LINES 15-17 .. code-block:: default X, y, A = load_dataset("cora", data_home="../../datasets") .. GENERATED FROM PYTHON SOURCE LINES 18-21 .. code-block:: default G = nx.from_scipy_sparse_matrix(A) C = max(nx.connected_components(G), key=len) .. GENERATED FROM PYTHON SOURCE LINES 22-29 .. code-block:: default fig, ax = plt.subplots(figsize=(15, 12)) nx.draw(G.subgraph(C), node_color=y[list(C)].argmax(axis=1), node_size=25, alpha=0.4, cmap="Accent", ax=ax) plt.show() .. image:: /auto_examples/datasets/images/sphx_glr_plot_cora_001.png :alt: plot cora :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 21.812 seconds) .. _sphx_glr_download_auto_examples_datasets_plot_cora.py: .. only :: html .. container:: sphx-glr-footer :class: sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_cora.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_cora.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_