.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/2D/11-plot2d_fonts.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_gallery_2D_11-plot2d_fonts.py: Set font ================ .. image:: ../../_static/cigvis/2D/11.png :alt: image :align: center .. GENERATED FROM PYTHON SOURCE LINES 14-56 .. code-block:: default # sphinx_gallery_thumbnail_path = '_static/cigvis/2D/11.png' import matplotlib import cigvis import numpy as np import matplotlib.pyplot as plt # set font family font = {'family': 'Times New Roman', 'size': 12} matplotlib.rc('font', **font) d = np.fromfile('../../data/rgt/sx.dat', np.float32).reshape(128, 128, 128) sl = d[30, :, :] fig, axes = plt.subplots(1, 2, figsize=(12, 6)) cigvis.plot2d(sl, xlabel='xline', ylabel='time', title='origin', cbar='Amplitude', ax=axes[0]) cigvis.plot2d(sl, xlabel='xline', ylabel='time', title='set font size', cbar='Amplitude', title_size=16, xlabel_size=14, ylabel_size=14, ticklabels_size=12, cbar_label_size=14, cbar_ticklabels_size=12, ax=axes[1]) plt.tight_layout() plt.savefig('example.png', bbox_inches='tight', pad_inches=0.01, dpi=200) plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.000 seconds) .. _sphx_glr_download_gallery_2D_11-plot2d_fonts.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: 11-plot2d_fonts.py <11-plot2d_fonts.py>` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: 11-plot2d_fonts.ipynb <11-plot2d_fonts.ipynb>` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_