.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/plot_simple_arxiv.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_plot_simple_arxiv.py: Simple ArXiv ML --------------- Demonstrating some arrow and font styles that can be used with the ArXiv ML data map .. GENERATED FROM PYTHON SOURCE LINES 7-45 .. image-sg:: /auto_examples/images/sphx_glr_plot_simple_arxiv_001.png :alt: ArXiv ML Landscape, A data map of papers from the Machine Learning section of ArXiv :srcset: /auto_examples/images/sphx_glr_plot_simple_arxiv_001.png :class: sphx-glr-single-img .. code-block:: Python import datamapplot import numpy as np import requests import PIL import matplotlib.pyplot as plt import colorcet plt.rcParams['savefig.bbox'] = 'tight' arxivml_data_map = np.load("arxiv_ml_data_map.npz")["arr_0"] arxivml_labels = np.load("arxiv_ml_simplified_cluster_labels.npz", allow_pickle=True)["arr_0"] arxiv_logo_response = requests.get( "https://upload.wikimedia.org/wikipedia/commons/7/7a/ArXiv_logo_2022.png", stream=True, headers={'User-Agent': 'My User Agent 1.0'} ) arxiv_logo = np.asarray(PIL.Image.open(arxiv_logo_response.raw).convert("RGBA")) fig, ax = datamapplot.create_plot( arxivml_data_map, arxivml_labels, title="ArXiv ML Landscape", sub_title="A data map of papers from the Machine Learning section of ArXiv", logo=arxiv_logo, font_family="Montserrat Thin", label_font_size=9.5, label_margin_factor=1.0, arrowprops={ "arrowstyle": "wedge", "connectionstyle": "arc3,rad=0.3", "linewidth": 0.25, "ec": "#4f3e2d" }, title_keywords={"fontfamily":"Montserrat Thin", "fontweight":"black", "fontsize":36}, sub_title_keywords={"fontfamily":"Montserrat Thin", "fontsize":22}, glow_keywords={"n_levels":16, "kernel":"exponential", "kernel_bandwidth":0.2}, cmap=colorcet.cm.CET_L9, ) fig.savefig("plot_simple_arxiv.png", bbox_inches="tight") plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 10.870 seconds) .. _sphx_glr_download_auto_examples_plot_simple_arxiv.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_simple_arxiv.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_simple_arxiv.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_simple_arxiv.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_