.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/plot_arxiv_ml.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_arxiv_ml.py: ArXiv ML -------- Demonstrating some custom styles that can be used with the ArXiv ML data map .. GENERATED FROM PYTHON SOURCE LINES 7-40 .. image-sg:: /auto_examples/images/sphx_glr_plot_arxiv_ml_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_arxiv_ml_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 plt.rcParams['savefig.bbox'] = 'tight' arxivml_data_map = np.load("arxiv_ml_data_map.npz")["arr_0"] arxivml_labels = np.load("arxiv_ml_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="Playfair Display SC", label_linespacing=1.25, label_font_size=8, title_keywords={"fontsize":45.65, "fontfamily":"Playfair Display SC Black"}, label_margin_factor=1.0, darkmode=True ) fig.savefig("plot_arxiv_ml.png", bbox_inches="tight") plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 24.980 seconds) .. _sphx_glr_download_auto_examples_plot_arxiv_ml.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_arxiv_ml.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_arxiv_ml.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_arxiv_ml.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_