You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
legend [INFORMATION]: Processing input text table data
legend [INFORMATION]: Processing hidden legend specification file /Users/israel/.gmt/sessions/gmt_session.21374/gmt.1.legend
legend [INFORMATION]: Reading Data Table from File /Users/israel/.gmt/sessions/gmt_session.21374/gmt.1.legend
legend [INFORMATION]: Central meridian not given, default to -179.678
legend [INFORMATION]: Map scale is 9.45374 km per cm or 1:945374.
legend [INFORMATION]: Legend height not given, using estimated height of 1.40367 cm.
plot [INFORMATION]: Processing input table data
plot [INFORMATION]: Map scale is 0.001 km per inch or 1:39.3701.
plot [INFORMATION]: Reading Data Table from memory reference supplied by pointer
plot [ERROR]: Could not find either custom symbol or EPS macro
Looking at the temporary file generated, we find the following content:
# Auto-generated legend information file
# LEGEND_JUSTIFICATION: RT
# LEGEND_SCALING: 1
# LEGEND_FRAME: 1p white 0.2c
S - k 0.222222i red - - Plot1
S - k 0.222222i green - - Plot2
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:
# Auto-generated legend information file
# LEGEND_JUSTIFICATION: RT
# LEGEND_SCALING: 1
# LEGEND_FRAME: 1p white 0.2c
S - kvolcano 0.222222i red - - Plot1
S - kvolcano 0.222222i green - - Plot2
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.
👋 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.
ibrewster
changed the title
Auto-generated legend doesn't work with eps symbols
Auto-generated legend doesn't work with "custom" (k) symbols
Mar 31, 2022
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()"
:The text was updated successfully, but these errors were encountered: