How do I get rid of a line in a map I made through pygmt?

I have an xyz file of longitude, lattitude, and altitude values I read into pygmt. The data looks like this:

           lon        lat       alt

0 -179.99581 -80.004223 -2.838170
1 -179.98743 -80.004223 -2.842787
2 -179.97905 -80.004223 -2.847498
3 -179.97067 -80.004223 -2.852296
4 -179.96229 -80.004223 -2.863034
… … … …
51250082 179.96229 -89.993253 1.286149
51250083 179.97067 -89.993253 1.286149
51250084 179.97905 -89.993253 1.286149
51250085 179.98743 -89.993253 1.286149
51250086 179.99581 -89.993253 1.286149

When I plot this in pyGMT the plot has a small line in it where the longitude goes from -180 to 180. Im guessing that is because there is no overlap in the data. There is no altitude datapoint for both -180 and +180 degrees longitude.

How do I get rid of this little line without making up fake data? Here is the python code:

fig = pygmt.Figure()
grid = pygmt.xyz2grd(data=dframe,
region=‘-179.995809958332359/179.995809958332359/-89.9932532328828358/-80.0042231338216681’, spacing=[long_spacing, lat_spacing])
fig.grdimage(grid=grid, frame=True, region=‘-180/180/-90/-81’, projection=‘S0/-90/50c’, # lowercase “S” throws a fatal error for some reason.
cmap=‘viridis’)
fig.show()
fig.savefig(savepath)

I was able to just make another .nc file with coordinates transformed to lon and lat. That did it.

set PROJ_IGNORE_CELESTIAL_BODY=YES

gdalwarp -t_srs EPSG:4326 C:\path\ldem_80s_20m_float.lbl C:\path\ldem_80s_20m_float_lonlat.nc

I did not need to call xyz2grd and pass through the pandas dataframe. I just used grdimage with the .nc file.

import pygmt
from osgeo import gdal
import os

filepath = (r"C:\Users\__\PycharmProjects\LunarSouthPoleLRO\LROData"
r"\ldem_80s_20m\float_img\ldem_80s_20m_float_lonlat.nc")
savepath = (r"C:\Users\_me_\PycharmProjects\LunarSouthPoleLRO\pyGMTfigures"
r"\ldem_80s_20m\ldem_80s_20m_float_nc_lonlat.png")

fig = pygmt.Figure()
fig.grdimage(
grid=filepath,
frame=True,
region=‘-180/180/-90/-80’,
projection=‘S0/-90/50c’,
cmap=‘viridis’
)
fig.show()
fig.savefig(savepath)

I can remove the region parameter in the plot and it will still give me the plot, just a square inside of a circle.

It works normally if I leave region in though

Kinda answered my own question by just experimenting but will leave this up as a resource for other people.