I’m using PyGMT in Jupyter Notebook.
My figures – both in the Jupyter Notebook (“fig.show()”) and the saved .png (“fig.savefig(png_file)”) – get cut off towards the bottom.
My general process is:
[1] Set the figure width:
>> fig_width = 20
>> xsize = fig_width
[2] Calculate the figure height:
>> ysize = xsize * ( (region[3] - region[2])/(region[1] - region[0]) )
[3] Set the projection:
>> projection = ‘X{}c/{}c’.format(xsize, ysize)
I usually have a series of maps and charts on a single figure. Invariably the bottom few cm of the final figure is chopped off, so I reduce “fig_width” by trial-and-error until it all fits.
But there are a couple of issues with this:
- the lower I go, the lower the resolution of the final image
- I have to reduce FONT and MAP_FRAME_PEN configurations to make things scale
>> pygmt.config(FONT=‘6,Helvetica,black’)
>> pygmt.config(MAP_FRAME_PEN=‘0.2p,black’)
I’ve tried increasing the paper size and increasing the resolution:
>> pygmt.config(PS_MEDIA=‘a0’)
>> pygmt.config(GMT_GRAPHICS_DPU=‘600i’)
but neither seems to work.
I’d appreciate advice!