Skip to content

pslegend cannot plot custom symbols #442

Closed

Description

@seisman

Full script that generated the error

#!/bin/bash
gmt psxy -JM4i -R0/10/0/10 -B2 -S -K > custom.ps << EOF
2 5 1c kcross
5 5 1c a
7 5 1c t
EOF
gmt pslegend -J -R -F+p1p -DjBR+w1.2i+o0.2c/0.2c -O << EOF >> custom.ps
S 0.2c kcross 0.15i blue 0.5p 1c cross
S 0.2c a 0.15i red 0.5p 1c capital
S 0.2c t 0.15i green 0.5p 1c station
EOF

Full error message

psxy [ERROR]: Could not find either custom symbol or EPS macro
psxy [ERROR]: Could not find custom symbol

System information

  • Operating system: macOS
  • Version of GMT: 6.0.0 latest

Activity

  1. seisman commented on Feb 27, 2019

    @seisman
    MemberAuthor

    Fixed in #450.

  2. liamtoney commented on Feb 8, 2022

    @liamtoney
    Member

    I'm running into this issue using PyGMT. Posting here as I see an issue...

    import pygmt
    
    fig = pygmt.Figure()
    fig.plot(x=1, y=1, style='kltriangle/0.1i', frame=True, region=[0, 2, 0, 2], projection='X2i', label='test')
    fig.legend()
    
    fig.show()

    gives this error:

    plot [ERROR]: Could not find either custom symbol or EPS macro
    

    and no legend appears.

    PyGMT version info:

    PyGMT information:
      version: v0.5.0
    System information:
      python: 3.10.2 | packaged by conda-forge | (main, Feb  1 2022, 19:30:18) [Clang 11.1.0 ]
      executable: /opt/miniconda3/envs/tonga_AK/bin/python
      machine: macOS-12.2-x86_64-i386-64bit
    Dependency information:
      numpy: 1.21.5
      pandas: 1.4.0
      xarray: 0.21.1
      netCDF4: 1.5.8
      packaging: 21.3
      ghostscript: 9.54.0
      gmt: 6.3.0
    GMT library information:
      binary dir: /opt/miniconda3/envs/tonga_AK/bin
      cores: 8
      grid layout: rows
      library path: /opt/miniconda3/envs/tonga_AK/lib/libgmt.dylib
      padding: 2
      plugin dir: /opt/miniconda3/envs/tonga_AK/lib/gmt/plugins
      share dir: /opt/miniconda3/envs/tonga_AK/share/gmt
      version: 6.3.0
    
  3. maxrjones commented on Feb 8, 2022

    @maxrjones
    Member

    I think that the fix did not extend to auto-legend making with -l. For example:
    Works

    gmt psxy -JM4i -R0/10/0/10 -B2 -S -K > custom.ps << EOF
    2 5 1c kcross
    5 5 1c a
    7 5 1c t
    EOF
    gmt pslegend -J -R -F+p1p -DjBR+w1.2i+o0.2c/0.2c -O << EOF >> custom.ps
    S 0.2c kcross 0.15i blue 0.5p 1c cross
    S 0.2c a 0.15i red 0.5p 1c capital
    S 0.2c t 0.15i green 0.5p 1c station
    EOF
    

    Doesn't work

    gmt begin test png
        echo 1 1 | gmt plot -Skltriangle/0.1i -B -R0/2/0/2 -JX2i -l"ltriangle"
        # gmt legend -DjTR+o0.5c -F+pthick+ithinner+gwhite
    gmt end show
    

    Works

    gmt begin test2 png
        echo 1 1 | gmt plot -Skltriangle/0.1i -B -R0/2/0/2 -JX2i
        echo S 0.2c kltriangle 0.1i white 0.5 1c ltriangle | gmt legend -DjTR+o0.5c -F+pthick+ithinner+gwhite
    gmt end show
    
  4. liamtoney commented on Feb 8, 2022

    @liamtoney
    Member

    That would make sense. Thanks @meghanrjones.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions