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

Discussion about aliases for multi-axis log/power projections #664

Open
adigitoleo opened this issue Jul 19, 2021 · 4 comments
Open

Discussion about aliases for multi-axis log/power projections #664

adigitoleo opened this issue Jul 19, 2021 · 4 comments

Comments

@adigitoleo
Copy link

adigitoleo commented Jul 19, 2021

When trying to copy the second GMT tutorial into GMT.jl I have encountered a missing symbol (I think). The GMT command I want to reproduce is:

gmt begin GMT_tut_2
	gmt basemap -R1/10000/1e20/1e25 -JX9il/6il -Bxa2+l"Wavelength (m)" -Bya1pf3+l"Power (W)" -BWS
gmt end show

Both the x and y axis are in a log scale. At the moment, this can be achieved by specifying the l flag to the figsize strings:

function tutorial2()
    basemap(
        region = (1, 10000, 1e20, 1e25),
        figsize = ("9il", "6il"),
        frame = (
            axes = (:left_full, :bottom_full),
            xlabel = "Wavelength (m)",
            ylabel = "Power (W)",
        ),
        xaxis = (annot = 2, ticks = :auto),
        yaxis = (annot = "1p", ticks = 3),
        show = true,
        Vd = 1,
    )
end

However, it would be nice to separate projection and size. Maybe there could be distinct xproj and yproj arguments (larger change, would require rework of existing projection bindings) or just a :logxy projection. Let me know which one of these you prefer, and I will look into an implementation (unless you already have something planned).

EDIT: To stay consistent with the map projection syntax, maybe it would be better to use something like proj = (name = :log, apply = "xy").

@adigitoleo adigitoleo changed the title Add distinct x and y projections (or a log-log projection) Add alias for mulit-axis log projection Jul 19, 2021
@joa-quim
Copy link
Member

Hmm, proj can take the values logx, logy, loglog, powx, powy

E.g. from the tests file

basemap(region=(1,1000,0,1), proj=:logx, figsize=(8,0.7), frame=(annot=1, ticks=2, grid=3, scale=:pow), show=1)

@adigitoleo
Copy link
Author

Aha! yes, the :loglog is what I needed. Thanks. I can't see it in the documentation for proj, although the linked GMT docs eventually revealed the l option to -J. Maybe the linear aliases that you listed can be added to the table in the proj docs?

@joa-quim
Copy link
Member

Yes, I fished them in the code 🙁. Made a small commit that added them to proj docs but I fear it's not enough. GMT splits the log and power plots controls between proj (-J) and axes (-B) which is not obvious to condense in a nice simple syntax. This is an area where we clearly need testing and examples ... feel free to.

@adigitoleo adigitoleo changed the title Add alias for mulit-axis log projection Discussion about aliases for multi-axis log/power projections Jul 23, 2021
@adigitoleo
Copy link
Author

I see, I'll have to table this until I get more time to explore these options, but I'll keep this open for discussion.

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