pygmt.clib.Session.create¶
- 
Session.create(name)[source]¶
- Create a new GMT C API session. - This is required before most other methods of - pygmt.clib.Sessioncan be called.- Warning - Usage of - pygmt.clib.Sessionas a context manager in a- withblock is preferred over calling- pygmt.clib.Session.createand- pygmt.clib.Session.destroymanually.- Calls - GMT_Create_Sessionand generates a new- GMTAPI_CTRLstruct, which is a- ctypes.c_void_ppointer. Sets the- session_pointerattribute to this pointer.- Remember to terminate the current session using - pygmt.clib.Session.destroybefore creating a new one.- Parameters
- name (str) – A name for this session. Doesn’t really affect the outcome.