Skip to content

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

Open
PaulWessel wants to merge 3 commits into
masterfrom
nondim-scale-plot
Open

WIP Ensure vector +z is nondimensional or uses unit q only#7047
PaulWessel wants to merge 3 commits into
masterfrom
nondim-scale-plot

Conversation

@PaulWessel

Copy link
Copy Markdown
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.
@PaulWesselPaulWessel added the bug Something isn't working label Sep 30, 2022
@joa-quim

Copy link
Copy Markdown
Member

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

@PaulWesselPaulWessel changed the title WIP: Ensure vector +z is nondimensional or uses unit q onlyEnsure vector +z is nondimensional or uses unit q onlyOct 2, 2022
@PaulWessel

Copy link
Copy Markdown
MemberAuthor

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

@joa-quim

Copy link
Copy Markdown
Member

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

@PaulWesselPaulWessel changed the title Ensure vector +z is nondimensional or uses unit q onlyWIP Ensure vector +z is nondimensional or uses unit q onlyOct 2, 2022
@PaulWessel

Copy link
Copy Markdown
MemberAuthor

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

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugSomething isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@PaulWessel@joa-quim