From d468a8223ed6391936c32a2ff782afd7ce869d67 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Thu, 26 Oct 2023 22:45:18 +0800 Subject: [PATCH] Figure.savefig: Support PPM (.ppm) format --- pygmt/figure.py | 2 ++ pygmt/tests/test_figure.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pygmt/figure.py b/pygmt/figure.py index e5b5cbf7184..84470c43827 100644 --- a/pygmt/figure.py +++ b/pygmt/figure.py @@ -263,6 +263,7 @@ def savefig( - JPEG (``.jpg`` or ``.jpeg``) - PDF (``.pdf``) - BMP (``.bmp``) + - PPM (``.ppm``) - TIFF (``.tif``) - GeoTIFF (``.tiff``) - EPS (``.eps``) @@ -305,6 +306,7 @@ def savefig( "pdf": "f", "jpg": "j", "bmp": "b", + "ppm": "m", "eps": "e", "tif": "t", "tiff": None, # GeoTIFF doesn't need the -T option diff --git a/pygmt/tests/test_figure.py b/pygmt/tests/test_figure.py index 4969aad0fb0..dd52462f677 100644 --- a/pygmt/tests/test_figure.py +++ b/pygmt/tests/test_figure.py @@ -83,7 +83,7 @@ def test_figure_savefig_exists(): fig = Figure() fig.basemap(region="10/70/-300/800", projection="X3i/5i", frame="af") prefix = "test_figure_savefig_exists" - for fmt in "png pdf jpg jpeg bmp eps tif PNG JPG JPEG Png".split(): + for fmt in "png pdf jpg jpeg bmp ppm eps tif PNG JPG JPEG Png".split(): fname = ".".join([prefix, fmt]) fig.savefig(fname)