diff options
author | Norbert Preining <norbert@preining.info> | 2023-08-31 03:01:22 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2023-08-31 03:01:22 +0000 |
commit | 7cda3a1cc32bd43dab837e2b73046dab2aeaec98 (patch) | |
tree | 48236f7b604cedb33b9977bcf4960b7dd5313641 /fonts/metsymb/source/metsymb_mwe.py | |
parent | 4fee29360f7566a474b6143951b0744fa151edc9 (diff) |
CTAN sync 202308310301
Diffstat (limited to 'fonts/metsymb/source/metsymb_mwe.py')
-rwxr-xr-x | fonts/metsymb/source/metsymb_mwe.py | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/fonts/metsymb/source/metsymb_mwe.py b/fonts/metsymb/source/metsymb_mwe.py new file mode 100755 index 0000000000..fd815162fa --- /dev/null +++ b/fonts/metsymb/source/metsymb_mwe.py @@ -0,0 +1,35 @@ +# -*- coding: utf-8 -*- +""" +Copyright (C) 2021 MeteoSwiss, +originally written by F.P.A. Vogt; frederic.vogt@meteoswiss.ch + +This file may be distributed and/or modified under the conditions +of the BSD-3-Clause License. +The terms of this license are available at: + +https://opensource.org/licenses/BSD-3-Clause + +SPDX-License-Identifier: BSD-3-Clause + +Module content: minimal working example of the metsymb LaTeX package +with matplotlib figures. +""" + +# Import matplotlib +from matplotlib import pyplot as plt + +# Set the proper rcparams elements +plt.style.use('./metsymb_mwe.mplstyle') + +# Create a basic figure with some demo text in the center. +plt.close(1) +plt.figure(1, figsize=(4, 0.5)) +plt.text(0.5, 0.5, + r'\LARGE Hello World: \threeoktas \nimbostratus \chIX', + ha='center') +plt.axis('off') + +# Export to different format and display on-screen. +plt.savefig('metsymb_mwe.pdf') +plt.savefig('metsymb_mwe.png') +#plt.show() |