GenericMappingTools / GenericMappingTools/GMT.jl

Should we set -J and -B defaults in modern mode (after `gmtbegin`)?

Open
#703 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Julia
Stars
221
Forks
36
Avg merge
1h 36m
Merged PRs (30d)
17

Description

Currently, when using modern mode the defaults for projection (-J) and frame (-B) are not set, for example:

```julia
julia> basemap(region = :g, show = true) # Works because it sets implicit defaults for -J and -B

julia> gmtbegin()

julia> basemap(region = :g)
basemap [ERROR]: Must specify at least one of -A, -B, -D, -L, -T
ERROR: Something went wrong when calling the module. GMT error number = 71
Stacktrace:
[1] gmt(cmd::String, args::Nothing)
@ GMT ~/.julia/packages/GMT/lcweZ/src/gmt_main.jl:283
[2] finish_PS_module(d::Dict{Symbol, Any}, cmd::Vector{String}, opt_extra::String, K::Bool, O::Bool, finish::Bool, args::Nothing)
@ GMT ~/.julia/packages/GMT/lcweZ/src/common_options.jl:3399
[3] basemap(cmd0::String, arg1::Nothing; first::Bool, kwargs::Base.Iterators.Pairs{Symbol, Symbol, Tuple{Symbol}, NamedTuple{(:region,), Tuple{Symbol}}})
@ GMT ~/.julia/packages/GMT/lcweZ/src/psbasemap.jl:67
[4] top-level scope
@ REPL[43]:1

julia> gmtend()

julia> basemap(region = :g, Vd = 2)
"psbasemap -Rg -JX14c/0 -Baf -BWSen -P -K > /tmp/GMTjl_tmp.ps"

julia> gmtbegin()

julia> basemap(region = :g, Vd = 2)
"basemap -Rg"

julia> gmtend()

```

It happens with the other functions as well of course (not just `basemap`). I think the defaults that are set in classic mode are quite nice, so maybe it wouldn't hurt to use them in modern mode as well? I'm not sure anything is lost by doing this: if the user wants a different projection/frame, they can still override the defaults. Also, the behaviour becomes more consistent with classic mode.

I can have a go at a patch (probably not before the weekend) if you're short on time. Just thought I'd raise the point.

Cheers

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.