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

Ticks in GeoAxis are inside the plot #190

Open
ronisbr opened this issue Jan 15, 2024 · 3 comments
Open

Ticks in GeoAxis are inside the plot #190

ronisbr opened this issue Jan 15, 2024 · 3 comments

Comments

@ronisbr
Copy link

ronisbr commented Jan 15, 2024

Hi!

The following code:

    fig = Figure(; size = (800, 800), kwargs...)

    ax = GeoAxis(
        fig[1, 1],
        aspect = nothing,
        xlabel = "Longitude [°]",
        xlabelsize = 26,
        xticklabelsize = 28,
        ylabel = "Latitude [°]",
        ylabelsize = 26,
        yticklabelsize = 28,
        title = "Ground Trace",
        titlegap = 16,
        titlesize = 28,
        dest = "+proj=ortho", # the CRS in which you want to plot
    )

    lp = lines!(ax, GeoMakie.coastlines(); transformation = (; translation = (0, 0, 1)))

returns this figure:

Captura de Tela 2024-01-15 às 13 44 05

Notice that the ticks are inside the plot, which should not happen. I tried everyone configuration described in Makie.jl manual to adjust the tick padding but none of them worked.

@ronisbr
Copy link
Author

ronisbr commented Jan 15, 2024

I managed to change it a little (but without a good consistency) using xlabelpadding and ylabelpadding:

    ax = GeoAxis(
        fig[1, 1],
        aspect = nothing,
        xlabel = "Longitude [°]",
        xlabelsize = 26,
        xticklabelsize = 28,
        ylabel = "Latitude [°]",
        ylabelsize = 26,
        yticklabelsize = 28,
        title = "Ground Trace",
        titlegap = 16,
        titlesize = 28,
        dest = "+proj=ortho", # the CRS in which you want to plot
        xlabelpadding = 15,
        ylabelpadding = 15,
    )

leading to:

Captura de Tela 2024-01-15 às 13 57 20

However, this behavior seems wrong. According to Makie.jl documentation, [x,y]labelpadding is:

The padding between the xlabel and the ticks or axis.

The correct parameter to change the padding is [x,y]ticklabelpad.

@ronisbr
Copy link
Author

ronisbr commented Apr 22, 2024

Bump!

@asinghvi17
Copy link
Member

About the naming issue, it looks like we used the wrong name when writing GeoAxis :D - the documentation for GeoAxis specifically should have the correct info.

About the ticks, I had a solution that worked a bit better than this at some point. Will try to dig it out.

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