Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

contour cann't recognise pen=(colored=true,) #373

Closed
htyeim opened this issue Jun 2, 2020 · 1 comment
Closed

contour cann't recognise pen=(colored=true,) #373

htyeim opened this issue Jun 2, 2020 · 1 comment

Comments

@htyeim
Copy link
Contributor

htyeim commented Jun 2, 2020

Some pieces of information (ref)
pen=(colored=true,) can't be recognized correctly.

If used Vd, it can be found that the option -W is of no parameter.

pscontour  -R0/360/-90/90 -A+f5+="MLAT " -W -C
pscontour  -R0/360/-90/90 -A+f5+="ZEN " -W -C

so the output is not correct...

contour_pen_test

but if I change pen=(colored=true,) to pen = "+c", it works:

contour_pen_test


data and code:

contour_testdata.jld2.zip

using GMT
using Libdl


using JLD2
@load "contour_testdata.jld2" xxs yys mlats mlons xxs_z yys_z zeniths

lon = 90.0

gmtbegin()
gmtfig("contour_pen_test", fmt = "png")
baseregion = (0, 360, -90, 90)

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(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,
            )

mlat_range = (-90.0, 90.0, 30.0)
zenith_range = (5.0, 180.0, 20.0)

    
cpt_mlat = makecpt(color = :jet, range = mlat_range,
                    # continuous = true,
                
                    ); 
cpt_zenith = makecpt(color = :jet, range = zenith_range,
            # continuous = true,
            reverse = "c",
            ); 
function get_GMTds(ilon, ilat, idat)
    ds = GMT.GMTdataset(hcat(vec(ilon), vec(ilat), vec(idat)))
    ds
end
            
for ik in keys(xxs)
    contour(get_GMTds(xxs[ik], yys[ik], mlats[ik]),
                    # pen = "0.5p,+c",
                    pen = (colored = true,),
                    # fill=true,
                    annot = (labels = (font = 5, prefix = "MLAT ",),),
                    color = cpt_mlat,
                    Vd = 1,
                    region = baseregion,
                    )

    contour(get_GMTds(xxs_z[ik], yys_z[ik], zeniths[ik]),
                    # pen = "0.5p,--,+c",
                    pen = (colored = true,),
                    # fill=true,
                    annot = (labels = (font = 5, prefix = "ZEN ",),),
                    color = cpt_zenith,
                    Vd = 1,
                    region = baseregion,
                )
end

gmtend()
@joa-quim
Copy link
Member

joa-quim commented Jun 2, 2020

Thanks. Should be fixed in master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants