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

WIP Ensure vector +z is nondimensional or uses unit q only #7047

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

PaulWessel
Copy link
Member

See #7039 for discussion. The coding of modifier +z was expecting plot units but that makes no sense. This PR checks that either no unit or q is appended and errors otherwise.

Hi @joa-quim, if you have time, please note that vector2d_mods.sh and vector3d_mods.sh now fail (left column row 4) but I think those are not failures but confusion about what units are used etc. We are doing

Input: 2.20 1.27 Vector: -Sv20p+e+z1q

So with q that means the input is user units to be converted via -R -J to plot units, then scaled by 1. So given the previous plot row has

Input: 2.20 1.27 Vector: -Sv20p+e+z0.394q+c --PROJ_LENGTH_UNIT=inch

it should be longer by 2.54. The --PROJ_LENGTH_UNIT should not have any implication here since input is not in plot units but in user units. Seems to me the original PS is wrong due to the bug we are trying to fix. Let me know what you think.

See #7039 for discussion. The coding of modifier +z was expecting plot units but that makes no sense.  This PR checks that either no unit or q is applied and errors otherwise.
@PaulWessel PaulWessel added the bug Something isn't working label Sep 30, 2022
@PaulWessel PaulWessel requested a review from joa-quim September 30, 2022 21:27
@joa-quim
Copy link
Member

joa-quim commented Oct 1, 2022

I have implemented patches Julia plot to workaround this bug and I think what I get is the right arrow. So, yes those tests have the wrong plots.

arrows([0 0 2.2 1.27], show=1, uv=true, Vd=1)
        psxy  -R-0.1/2.3/-0.04/1.32 -JX14c/9.5c -Baf -BWSen -Sv8p+e+h0.5+z5.833333333333333iq -P -K > C:\TEMP\GMTjl_tmp.ps

GMTjl_tmp

@PaulWessel PaulWessel changed the title WIP: Ensure vector +z is nondimensional or uses unit q only Ensure vector +z is nondimensional or uses unit q only Oct 2, 2022
@PaulWessel
Copy link
Member Author

OK, then I need a review t approve and I can update the PS later.

@joa-quim
Copy link
Member

joa-quim commented Oct 2, 2022

But the 2.54 factor is still there, as well as the problem when the axes are not isometric. See, I need to multiply by 2.54.

 echo 0 0 2.2 1.27 | gmt plot -R-0.1/2.3/-0.04/1.32 -JX14c/9.5c -Baf -BWSen -N -Sv8p+e+h0.5+z2.54q -png lixo

lixo

Regarding the non-isometry, I found that multiplying the yy* by a scale factor given by

(map_height / map_width) / ((y_max - y_min) / (x_max - x_min))

(9.5/14) / ((1.32+0.04)/(2.3+0.1)) * 1.27 = 1.5207983193277308

and a zscale given by map_width / (x_max - x_min)

14 / (2.3+0.1) / 2.54 = 2.2966
solves it.

echo 0 0 2.2 1.52 | gmt plot -R-0.1/2.3/-0.04/1.32 -JX14c/9.5c -Baf -BWSen -N -Sv8p+e+h0.5+z2.2966q -png lixo

lixo

@PaulWessel PaulWessel changed the title Ensure vector +z is nondimensional or uses unit q only WIP Ensure vector +z is nondimensional or uses unit q only Oct 2, 2022
@PaulWessel
Copy link
Member Author

Added WIP back on. Maybe have time to look at this tomorrow, but times are busy.

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 this pull request may close these issues.

2 participants