GenericMappingTools / GMT.jl

Generic Mapping Tools Library Wrapper for Julia
Other
193 stars 28 forks source link

Cannot parse option -l #1486

Closed ZMAlt closed 1 month ago

ZMAlt commented 1 month ago
julia> plot([2 2], J = "X3c", S = "c2p", R = "1/5/1/5", B = "af", l = "pos", savefig = "test.pdf")
Warning: the following options were not consumed in psxy => [:l]

julia> plot([2 2], J = "X3c", S = "c2p", R = "1/5/1/5", B = "af", label = "pos", savefig = "test.pdf")

julia> 
joa-quim commented 1 month ago

That is because -l is an option available only in GMT's modern mode, whilest label is the attempt to reproduce l in classic mode. That is, they are different options trying to achieve the same result.

ZMAlt commented 1 month ago
gmtbegin("test2.pdf")
plot([2 2], J = "X3c", S = "c2p", R = "1/5/1/5", B = "af", l = "pos")
gmtend()

The code above does produce a legend. However, the warning remains. I think the warning should be removed, or make l and label acceptable in any mode.

joa-quim commented 1 month ago

Checking the code, l or label were intended to work in both modes but it was not fully working. Hopefully it is now in master.

ZMAlt commented 1 month ago

At the moment, It‘s still not fully working in master as follows.


There is a legend with either l or label in classic mode. The warning remains for l.

julia> plot([2 2], J = "X3c", S = "c2p", R = "1/5/1/5", B = "af", l = "pos", savefig = "test.png")
Warning: the following options were not consumed in psxy => [:l]

julia> plot([2 2], J = "X3c", S = "c2p", R = "1/5/1/5", B = "af", label = "pos", savefig = "test.png")

julia>

test


In modern mode, there is no legend with label

julia> gmtbegin("test.png")

julia> plot([2 2], J = "X3c", S = "c2p", R = "1/5/1/5", B = "af", l = "pos")

julia> gmtend()

julia> gmtbegin("test.png")

julia> plot([2 2], J = "X3c", S = "c2p", R = "1/5/1/5", B = "af", label = "pos")
Warning: the following options were not consumed in plot => [:label]

julia> gmtend()

julia>

l test

label test

joa-quim commented 1 month ago

Will look again when finished another issue I'm working in.

joa-quim commented 1 month ago

I have fixed some of those cases, but not the last. l is an alias to legend, not to label.

ZMAlt commented 1 month ago

I see. I think it works well. Time to close this. Thank you.