# PyCoast 1.6.0 BUG, see https://groups.google.com/g/pytroll/c/JW90QP9QXys import pyresample from PIL import Image from pycoast import ContourWriterPIL def get_ortho(lon_0, lat_0): area_def = pyresample.create_area_def( '1/2 World, orthographic', '+proj=ortho +lon_0='+lon_0+' +lat_0='+lat_0+' +ellps=WGS84 units=m', width=900, height=900, area_extent=[-6800000.0, -6800000.0, 6800000.0, 6800000.0]) return area_def # write_text = True does reproduce the bug, write_text = False is current workaround write_text = False lon_0, lat_0 = '0', '0' area_def = get_ortho(lon_0, lat_0) imagename = 'ortho-'+lon_0+'-'+lat_0+'.png' cw = ContourWriterPIL('./') # We take PIL because it has has a hardcoded default font img = Image.new('RGB', (900, 900)) cw.add_grid(img, area_def, (10., 10.), (2., 2.), write_text=write_text, outline='white') img.save(imagename)