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

Failed to specify the suffix for latitudes (i.e. N/S) in the polar coordinate system (-Jp, -JP) #5120

Closed
zhong-yy opened this issue Apr 9, 2021 · 5 comments · Fixed by #5124
Assignees
Labels
bug Something isn't working

Comments

@zhong-yy
Copy link

zhong-yy commented Apr 9, 2021

Description of the problem
I wanted to plot data that are given in polar coordinates (latitude, radius), so I chose the linear projection -JP. But I encountered the following problems:

  1. The angle was treated as longitude by default rather than latitude, so the suffix was W or E.
  2. The options +llabel and +uunit didn't work under the projection with polar coordinates -JP.

Full script that generated the error

Here is a minimum working example:

gmt begin Jp jpg E300
    gmt set FORMAT_GEO_MAP ddd:mm:ssF
    gmt basemap -JP5c+z+t0 -R-30/30/4371/6371 -Bxa15f+u" N" -Bya+l"Depth (km)" -BWNse
gmt end show

I have tried -JP3c+z+t0+a, but it didn't work.

Actual outcome
Jp

Expected outcome

I want to change W (E) to S (N), like this:
image12

System information

  • Operating system: Ubuntu20.04
  • GMT version (gmt --version): 6.1.1
@zhong-yy zhong-yy added the bug Something isn't working label Apr 9, 2021
@PaulWessel PaulWessel self-assigned this Apr 9, 2021
@PaulWessel
Copy link
Member

Thanks for the post. I guess GMT cannot know what the angular measures are, so it will need to be told. It looks like it assumes these are always longitudes. I think we need to contemplate a situation where we can communicate to -JP the following

  1. The angles are longitude: Formatting will be as for longitude.
  2. The angles are latitude: Formatting will be as for latitude.
  3. The angles are just angles: Formatting will be for angles with degree symbol only.

I am guessing we need to add a new modifier to -JP|p, e.g. +kkind, where kind may be x (longitude) or y (latitude). The default would just be degrees.

Alternatively, we use -f0x and -f0y instead to indicate the same information.

Other thoughts on this, @joa-quim, @meghanrjones and @seisman ?

@maxrjones
Copy link
Member

Thanks for the post. I guess GMT cannot know what the angular measures are, so it will need to be told. It looks like it assumes these are always longitudes. I think we need to contemplate a situation where we can communicate to -JP the following

1. The angles are longitude: Formatting will be as for longitude.

2. The angles are latitude: Formatting will be as for latitude.

3. The angles are just angles: Formatting will be for angles with degree symbol only.

I am guessing we need to add a new modifier to -JP|p, e.g. +kkind, where kind may be x (longitude) or y (latitude). The default would just be degrees.

Alternatively, we use -f0x and -f0y instead to indicate the same information.

Other thoughts on this, @joa-quim, @meghanrjones and @seisman ?

This solution seems good to me.

@seisman
Copy link
Member

seisman commented Apr 9, 2021

I am guessing we need to add a new modifier to -JP|p, e.g. +kkind, where kind may be x (longitude) or y (latitude). The default would just be degrees.

This makes more sense to me.

@zhong-yy
Copy link
Author

Thanks for the post. I guess GMT cannot know what the angular measures are, so it will need to be told. It looks like it assumes these are always longitudes. I think we need to contemplate a situation where we can communicate to -JP the following

1. The angles are longitude: Formatting will be as for longitude.

2. The angles are latitude: Formatting will be as for latitude.

3. The angles are just angles: Formatting will be for angles with degree symbol only.

I am guessing we need to add a new modifier to -JP|p, e.g. +kkind, where kind may be x (longitude) or y (latitude). The default would just be degrees.

Alternatively, we use -f0x and -f0y instead to indicate the same information.

Other thoughts on this, @joa-quim, @meghanrjones and @seisman ?

Thank you for your quick reply. I'm looking forward to the new modifier. By the way, do you know how to enable the axis label for JP? In this example, I used -Bya+l"Depth (km)" and but "Depth (km)" didn't show.

@PaulWessel
Copy link
Member

No such option at the moment. I am having a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants