Add a "justify" option to psscale
While we are it with the psscale, I remember how boring is to adjust the -D do that the vertical color scale starts exactly aligned with the map south border frame. That could easily be addressed by adding a justification option like in
#1 Updated by Paul about 4 years ago
- Status changed from New to Feedback
Well, while we are at it, there may be more similar issues. My pet peeve is to place a vertical bar to the right of the map, but centered on the map height. Oops, what is the map height? Oh, depends on map projection. Must call map project etc to figure that out. Maybe xpos or ypos could be a justification tag, i.e.
psscale -DC/-0.2i/4i/0.1ih would see the x = "C" to mean centered and compute xpos given the plot width. Or -D5.2i/M/... to place it at the middle of the y height. Not exactly what your +j does but related. Or could it simply be
-D<xy_pos or justification>/length/height[h]
and if you gave CB it would place the scale centered beneath the map, RM would do what I wanted above, RB would be what you wanted, etc. There could be an automatic offset distance calculated or a modifier to specify it.
#4 Updated by Joaquim about 4 years ago
But to make it clear, those -R & -J must be the same of the plot right? And that means we will be writing outside the -R region and further away of the (-JX...) size since those are set to the plot and not to psscale. A bit confusing no? And not to mention that a plain -Dx will not be able to justify.
#5 Updated by Paul about 4 years ago
Perhaps I am missing your drift here but I don't see where the confusion would enter. For any GMT overlay you would want to stick with the same -R -J. So you make a map with some -R -J and now you want to add a map scale. You wish to use the map dimensions in this task, hence you pass -R -J and specify the psscale anchor point with either geographic coordinates or that justification tag. If you picked some other random -R -J of course you will be screwed, the same way you get screwed if you try pscoast overlay with another -R -J than the plot before it.
And yes, -DxLB etc will yield an error, as will other combinations that require -R -J if said -R -J are not provided.
-Dx15c/10c will not require -R -J. However, and I think I see where you are going with this, if you want your original suggestion to work then, yes, we may want a +j
to change what point on the scalebar the input x0,y0 point refers to [default is top center on bar].
#6 Updated by Joaquim about 4 years ago
I guess that what I'm anticipating a bit strange is to do
grdimage -R-R0/10/0/10 -JM10 ...
psscale -R0/10/0/10 -JM10 -D11/M/...
and getting a map that will be larger than 10, but I don't see a way out of it if we want to use the -R -J facility to do automatic placing.
And yes for the +j and my original suggestion.