Skip to content

Possible text bug with fig.meca when plotting from a file #1367

@hazardgoat

Description

@hazardgoat

Description of the problem
I think I may have run across a bug with fig.meca when attempting to plot from a file. Column names are being plotted in the bottom left corner, and the issue disappears when column names are removed from the file.

Full code that generated the error

import pygmt
import os

# Main File Path ----------------------------------
main_dir = r'C:\Users\USER\Desktop\TESTING'

# Save Path ----------------------------------
save_name = os.path.join(main_dir, 'Results', 'map_TEST.png')

# Focal Mechanism Path ----------------------------------    
focal_mecha = os.path.join(main_dir, 'Data', 'selected_fm.csv')


fig = pygmt.Figure()

fig.basemap(
    region = [-115.85, -115.35, 32.80, 33.38],
    projection = 'M6i',
    frame = True
)
fig.coast(
    land = 'grey',
    water = 'lightskyblue2',
)
fig.meca(
    spec = focal_mecha,
    convention = 'aki',
    scale = '1.0c',
    offset = True,
    )

fig.savefig(save_name)
print('done')

System information
PyGMT information:
version: v0.4.0
System information:
python: 3.9.5 (tags/v3.9.5:0a7dcbd, May 3 2021, 17:27:52) [MSC v.1928 64 bit (AMD64)]
executable: C:\Users\USER\AppData\Local\Programs\Python\Python39\python.exe
machine: Windows-10-10.0.19043-SP0
Dependency information:
numpy: 1.21.0
pandas: 1.2.5
xarray: 0.18.2
netCDF4: 1.5.7
packaging: 20.9
ghostscript: 9.54.0
gmt: 6.2.0
GMT library information:
binary dir: C:/Users/USER/AppData/Local/Programs/Python/Python39
cores: 4
grid layout: rows
library path: c:/programs/gmt6/bin/gmt_w64.dll
padding: 2
plugin dir: c:/programs/gmt6/bin/gmt_plugins
share dir: c:/programs/gmt6/share
version: 6.2.0

My data:
selected_fm.csv

My map output:
map_TEST

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingupstreamBug or missing feature of upstream core GMT

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions