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

Can't plot data points out of the [-180, 180, -90, 90] range on geographic maps for external wrappers #8606

Open
seisman opened this issue Oct 28, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@seisman
Copy link
Member

seisman commented Oct 28, 2024

See https://forum.generic-mapping-tools.org/t/plotting-points-out-of-90-degree-range/5479 for the initial issue report.

To reproduce the issue:

import pygmt
fig = pygmt.Figure()
fig.basemap(region="d", projection="Q10i", frame="afg")
fig.coast(land="#666666", water="skyblue")
fig.plot(x=60, y=110, style="c0.3c", fill="red", pen="black", no_clip=True)
fig.show()

The error plot [WARNING]: Latitude (110) at line # 1 exceeds -|+ 90! - set to NaN comes from the gmtlib_process_binary_input function.

gmt/src/gmt_io.c

Line 4839 in 65e0917

GMT_Report (GMT->parent, GMT_MSG_WARNING, "Latitude (%g) at line # %" PRIu64 " exceeds -|+ 90! - set to NaN\n", GMT->current.io.curr_rec[col_no], GMT->current.io.rec_no);

The equivalent CLI version works as expected. The reason is that, for GMT CLI, gmtio_ascii_input is called to read the data points, but for external wrappers, data are passed in binary buffers, so the gmtio_bin_input is called instead.

I guess the same issue exists for GMT.jl, so it should be declared as a GMT bug.

@seisman seisman added the bug Something isn't working label Oct 28, 2024
@seisman seisman changed the title Can't plot data points out of the [-180, 180, -90, 90] range in geographic plots Can't plot data points out of the [-180, 180, -90, 90] range on geographic maps for external wrappers Oct 28, 2024
@joa-quim
Copy link
Member

Yep. This works

C:\v>echo 60 110 | gmt plot -Rd -JQ10i -Baf -BWSen -N -Gred -Sc7p -png lixo

but this, not

Julia> plot([60 110], region="d", projection="Q10i", marker="c0.3c", fill="red", no_clip=true, Vd=1)
        psxy  -Rd -JQ10i -Baf -BWSen -N -Gred -Sc7p -P -K > c:\TMP/GMTjl_j.ps
psxy [WARNING]: Latitude (110) at line # 1 exceeds -|+ 90! - set to NaN

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

No branches or pull requests

2 participants