Repository navigation
Closed
Labels
bugSomething isn't working
Description
First, the command
gmt psbasemap -R0/10/0/20/0/30 -JX5c/10c -JZ15c -Bswnez1 -pz135/40/0gives an error
psbasemap [ERROR]: Bad interval in -B option (x-component, a-info): wnez1 gave interval = 0
psbasemap [ERROR]: Bad interval in -B option (y-component, a-info): wnez1 gave interval = 0
psbasemap [ERROR]: Option -B parsing failure. Correct syntax:
-B Specify both (1) basemap frame settings and (2) axes parameters.
Frame settings are modified via an optional single invocation of -B[<axes>][+b][+g<fill>][+i[<val>]][+n][+o<lon>/<lat>][+s<subtitle>][+t<title>][+w[<pen>]][+x<fill>][+y<fill>][+z<fill>]
Axes parameters are specified via one or more invocations of -B[p|s][x|y|z]<intervals>[+a<angle>|n|p][+e[l|u]][+f][+l|L<label>][+p<prefix>][+s|S<secondary_label>][+u<unit>
<intervals> is composed of concatenated [<type>]<stride>[l|p] sub-strings. See basemap documentation for more details and examples of all settings.
psbasemap [ERROR]: Offending option -Bswnez1
If I replace "sw" with "ws" or "s" with "S" in the last -B option, the command works fine. The bug is small but curious.
Second, when shifting the xy plane by zlevel parameter of the -p option, the "+b" flag does not draw the bottom face of the cube
gmt psbasemap -R0/10/0/20/0/30 -JX5c/10c -JZ15c -Bwsenz1+b -pz135/40/10 -P >test1.ps+b (for 3-D plots) to draw the foreground lines of the 3-D cube
but some of the drawn lines are not foreground.
Third, the command
gmt psbasemap -R0/10/0/20/0/30 -JX5c/10c -JZ15c -Bxa+lx -Bya+ly -Bza+lz -BwsENZ1+b -px135/40/0 -P >test2.psproduces a result that I find it difficult to interpret. It looks like the z-axis is pointing wrong.

Metadata
Metadata
Assignees
Labels
bugSomething isn't working

Activity
joa-quim commentedon May 25, 2022
What is that 1 doing there? Without it it works fine.
Yeap, this one looks buggy. Here, removing the 1 makes no difference.
joa-quim commentedon May 25, 2022
I seem to remember that -p still has some weird behaviors in some corner cases. This works
uleysky commentedon May 25, 2022
The corner on the xy plane at which the z-axis is drawn. Number from 1 to 4.
uleysky commentedon May 25, 2022
Yes it works because the default is -pz. But I need -px to shift the yz-plane along the x-axis (as the xy-plane is shifted along the z-axis in the first picture).
joa-quim commentedon May 25, 2022
Ah, yes. Since I never used those corner options I forgot about them (and pretending to remember all -B varieties is high presumption).
joa-quim commentedon May 25, 2022
I think this one is easier to interpret and shows better the bug. Notice that I changed the y limits to show that it's not mixing y and z coordinates
joa-quim commentedon May 25, 2022
-p is somehow mixing the dimensions sizes. See this
But now we change the size of the z axis to the same as y, we get the correct plot
uleysky commentedon May 25, 2022
No, this is still incorrect. Pay attention to the y- and z-axes, they are parallel.
joa-quim commentedon May 25, 2022
The plane is correct. The labels not
seisman commentedon May 25, 2022
xref: #529
uleysky commentedon May 25, 2022
Agree. In your first drawing, the plane is also shifted correctly, only the frame is drawn incorrectly.
joa-quim commentedon Jun 10, 2023
Looking better at this I'm no longer convinced that this is a bug. What it does is the, useless, re-projection of one of the planes on another wall. And not using a cube the plane sides have do the same size as the wall where they are projected and hence we see what we see.
But on a more useful exercise, I'm trying to plot an image one the sides of a cube (that way well be the vertical sides of a
grdviewplot). And here we have bugs as well.This one is correct (commands in Julia but with plain GMT generated syntax below)
Now let's try to move it along the latitudinal axis. It wrongly moves it along the zz axis
@remkos do you still remember where is the code that deals with this?
joa-quim commentedon Jun 11, 2023
More work and more comprehension. The above image is not bugged either. It's raised in the xz plane because I first moved it up along lat with the
Dg-75/-48(origin is at -75,-50) and it was the-py135/30final rotation that put it in that position.The real problem that I'm facing right now is that the z in
azim/elev/zis ignored. Doing the trig in Julia to compute the necessary X,Y offsets I can nowremkos commentedon Jun 11, 2023
It was only designed to work on those three planes as illustrated in @joa-quim 's last post.
I remember from back when I created the implementation (>10y ago) that particularly the one illustrated before did not work.
The transformation matrix is actually not that difficult for the image projection, but I think Ghostscript appears to have limitations when negative numbers end up in it.
I never wrote those out (in frustration). But know there are.
The frames were later many times modified. I won't claim they were working 100% in the past, but also abdicate responsibility for it.
In any case the relatively simple transformation approach has faults and they may be due to limitations in Ghostscript.
joa-quim commentedon Jun 11, 2023
Remko, what I did was to compute the missing z feature obedience in terms of
-X<off>, -Y<off>(had to resort to mapproject to compute the new origin along the axis I wanted to slide on). We can´t blame Ghostscript for that. I tried to see if I could do the same thing in C but the code is very complicated for me to decipher it.And note also that plotting on the North side is not currently possible because it needs that z. Only the South side should work well.
joa-quim commentedon May 31, 2026
This was fixed in #9047