Skip to content

some Longitude regions will cause strange lines #398

@htyeim

Description

@htyeim

If I want to plot a region with longitude from 170 to 140 (which means 170-180 0-140, all without 140-170).
I can't give the region like this (170,140,-90,90), as GMT.jl/gmt will rise a error basemap [ERROR]: Option -R parsing failure. . But I found that the region could be (170-360,140,-90,90) or (170,140+360,-90,90). In most case it work fine, but for large regions like (170-360,155,-90,90) there will be some strange lines...

The code that can produce the strange figures:

using GMT
function test(rlon=[170,128])
    gmtbegin()
    gmtfig(string("test_R_", rlon[1], "_", rlon[2]), fmt="png")
    if rlon[1] > rlon[2]
        rlon[1] -= 360
    end
    baseregion = (rlon[1], rlon[2], -90, 90)
    lon = (baseregion[1] + baseregion[2]) / 2.0
    proj = (name = :Robinson,
            # center = [mean(baseregion[1:2]) mean(baseregion[3:4])],
            center = lon,)
    basemap(region=baseregion, proj=proj, frame=(axes = :WSen,),
                figsize=12, )
    topo = makecpt("-H", color=:geo, range=(-8800, 8800,), continuous=true);

    grdimage!("@earth_relief_20m.grd", region=baseregion,
                nan_alpha=true,
                color=topo,
                colorbar=true)
    coast(region=baseregion, 
            borders=(type = :a, pen = (0.06, :black, "--")),
            shore=(type = 1, pen = (0.6, :black,)), 
            # Vd=1,
            )
    gmtend()
end

for lon_right = 5:10:170
    test([170,lon_right]) 
end

(170,5,-90,90)
test_R_170_5

(170,145,-90,90)
test_R_170_145

(170,155,-90,90)
test_R_170_155

(170,165,-90,90)
test_R_170_165

It seems starts from (170,151) the strange lines appear. I don't know if this is related to #357

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions