pygmt icon indicating copy to clipboard operation
pygmt copied to clipboard

Add "-G" flag passthrough to psconvert for finding the correct gs version

Open ericlindsey opened this issue 3 years ago • 1 comments

As discussed here, if an old version of gs installed on Windows is referred to in the registry, psconvert will use the old gs instead of any newer versions that might be referred to in the path (psconvert checks the registry only and not the path).

This leads to an error in pygmt.show() if the gs in the registry is too old; currently there is no way to point pygmt.show() to a newer version except by adding the path to the newer version into the registry.

However, pygmt.show_versions() is able to find a newer version of gs referred to in the path, for example if both have been installed through conda. A suggested workaround is to enable pygmt.show() and pygmt.savefig() to use the same method to determine that path to gs, and pass it on to psconvert via the -G flag.

ericlindsey avatar Aug 03 '22 23:08 ericlindsey

👋 Thanks for opening your first issue here! Please make sure you filled out the template with as much detail as possible. You might also want to take a look at our contributing guidelines and code of conduct.

welcome[bot] avatar Aug 03 '22 23:08 welcome[bot]

@ericlindsey After PR #2076 and #2078, now it's possible to specify the ghostscript path in Figure.show() or Figure.savefig() by giving an argument like gs_path="/path/to/gs".

seisman avatar Aug 29 '22 11:08 seisman