Mixed geo/Cartesian annotations placed on wrong side of axis
|Target version:||Candidate for next bugfix release|
A basemap in which x is longitude and y is something non-geographic, say depth positive down, can be made with a purely Cartesian call:
psbasemap -R128/152/0/700 -JX5.5i/-5.5i -Ba2/a100 > good.ps
However, if we tell psbasemap that x is actually longitudes (to get proper degree symbols in the annotations), e.g.,
psbasemap -R128E/152E/0/700 -JX5.5i/-5.5i -Ba2/a100 > bad.ps
psbasemap -R128/152/0/700 -JX5.5id/-5.5i -Ba2/a100 > bad.ps
then the longitude annotations indeed have degree symbols but appear inside instead of outside the frame. Somehow the negative y-scale interferes with their vertical placement. This problem affects both GMT 4 and 5.
#1 Updated by Paul over 3 years ago
- Status changed from New to In Progress
- The reason one might want this to work is so that longitudes would be handled correctly, i.e., being treated as a periodic coordinate
- The problem only affects the frame annotations so one could use the desired projection to plot data and then use the first Cartesian version to overlay a suitable baseman. This is a good work-around.
- The reason the labels are on the wrong side is that somewhere it uses the fact that y-max is on the "upper" frame while y-min is on the lower, but of course this is reversed with the negative scale.
I will try to hunt for where this decision takes place...
#2 Updated by Paul over 3 years ago
- Status changed from In Progress to Resolved
- % Done changed from 0 to 100
Found a way to handle this: The crossing line machinery flags which side of the boundary we cross, with 0 and 2 meaning lower and upper. However, when y-scale is negative we must flip those two numbers in this mixed-type annotation case. Fixed in r10302 (GMT4) and r13918 (GMT 5). I added new test script test/psxy/mixed_axes.sh to check that all four cases work (lon with y in either direction and lat with x in either direction).