Open ibrewster opened 2 years ago
👋 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.
GMT does not yet support auto-generated legend items for custom symbols. This issue is being tracked upstream by https://github.com/GenericMappingTools/gmt/issues/1973.
Description of the problem When calling Figure.plot, you can specify a custom symbol by specifying the symbol with a k followed by the custom symbol name/file, such as
kvolcano/16p
. However, doing so breaks the auto-generated legend, failing with the following output:Looking at the temporary file generated, we find the following content:
In which we see that it put the "k" for the symbol into the file, but failed to specify the custom symbol to use. In fact, if we modify this autogenerated file to add the symbol name again, like so:
and then remove the label entries from our plots and feed the modified file in as the first parameter to legend (if we don't remove the
label=
entries from the plot command it always tries to use them, even with a file specified), we get the desired result.Full code that generated the error
NOTE: I have not tried this on straight GMT, only PyGMT.
System information
Please paste the output of
python -c "import pygmt; pygmt.show_versions()"
: