Feature #512

Add a "justify" option to psscale

Added by Joaquim over 4 years ago. Updated over 4 years ago.

Status:ClosedStart date:2014-02-12
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:-
Target version:-
Platform:

Description

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

-Dxpos/ypos/length/width[h][+j justify]

History

#1 Updated by Paul over 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.

#2 Updated by Joaquim over 4 years ago

Well, yes but this would only be possible when -J is used otherwise it wont know about the plot size/existence

#3 Updated by Paul over 4 years ago

True, but that is OK. The new -D[g|n|x] option can handle all kinds of stuff, but if you want to place things in relation to the plot box then -R -J will be required; otherwise use plot units.

#4 Updated by Joaquim over 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 over 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 over 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.

#7 Updated by Paul over 4 years ago

  • Status changed from Feedback to Resolved

This will all be addressed as part of the -D revamp to ensure consistency across psimage, pslegend, and psscale.

#8 Updated by Joaquim over 4 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF