Skip to content

Commit 4118126

Browse files
committed
Figure.savefig: Support PPM (.ppm) format
1 parent f828bc5 commit 4118126

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

pygmt/figure.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@ def savefig(
263263
- JPEG (``.jpg`` or ``.jpeg``)
264264
- PDF (``.pdf``)
265265
- BMP (``.bmp``)
266+
- PPM (``.ppm``)
266267
- TIFF (``.tif``)
267268
- GeoTIFF (``.tiff``)
268269
- EPS (``.eps``)
@@ -305,6 +306,7 @@ def savefig(
305306
"pdf": "f",
306307
"jpg": "j",
307308
"bmp": "b",
309+
"ppm": "m",
308310
"eps": "e",
309311
"tif": "t",
310312
"tiff": None, # GeoTIFF doesn't need the -T option

pygmt/tests/test_figure.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def test_figure_savefig_exists():
8383
fig = Figure()
8484
fig.basemap(region="10/70/-300/800", projection="X3i/5i", frame="af")
8585
prefix = "test_figure_savefig_exists"
86-
for fmt in "png pdf jpg jpeg bmp eps tif PNG JPG JPEG Png".split():
86+
for fmt in "png pdf jpg jpeg bmp ppm eps tif PNG JPG JPEG Png".split():
8787
fname = ".".join([prefix, fmt])
8888
fig.savefig(fname)
8989

0 commit comments

Comments
 (0)