-
Notifications
You must be signed in to change notification settings - Fork 401
Further vector scale improvements and enhancements #6197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
See #6190 for background.
maxrjones
reviewed
Jan 7, 2022
Co-authored-by: Meghan Jones <meghanj@alum.mit.edu>
Co-authored-by: Meghan Jones <meghanj@alum.mit.edu>
maxrjones
approved these changes
Jan 7, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
add-changelog
Add PR to the changelog
documentation
Improve documentation
enhancement
Improving an existing feature
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
See #6190 for background. This PR addresses the sub-tasks 1 , 2 and 6 (last task 5 will be handled after this PR is merged):
(Task 1): Offer a way, like +zscale, to accept polar form direction, length input, with length in data units to be scaled to plot units. I chose +vscale for "scale vector data length to plot length". Append a unit from c|i|p to indicate the unit of the product.
(Task 2): Allow the shrinking limit to be given in data units or plot units. Follow the lead of plot -Sb and use unit q to indicate data units (since no unit would mean cm and hence a plot unit for Cartesian vectors and km as map unit for geovectors).
(Task 6): Ensure that any use of vector modifiers that cannot apply in a particular module result in errors.
Along the way, a few other things had to happen:
Here is one of two new tests (for psxy, the psxyz is identical since I did not use any perspective view point):
This test (psxy/vector2_mods.sh) plots a bunch of 1 inch = 2.54 cm vectors (left) or 100 km geovectors (right) but it does so using a wide range of input, units and vector attributes; these are plotted as text. Top two row use the new +c modifier with a CPT and -W+c modifications. Left column is Cartesian, right column are geovectors. View them from the bottom to the top to see what is going on with the input. We test combination of unit-less and unit input points, vector components in plot or map units, and magnitudes and components in quantity units (q) scaled to suitable plot and map lengths. Note result for left side y = 3: Input length is given as 1i (with unit) so specifying PROJ_LENGHT_UNIT as cm has no effect since the data unit takes precedence. We experiment with the new +v and the improved +z modifier.