Skip to content
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

Let psvelo accept CPT and a richer way of coloring symbols #4901

Merged
merged 15 commits into from
Mar 4, 2021

Conversation

PaulWessel
Copy link
Member

Description of proposed changes

So far, only a constant color fill was allowed for the symbols offered by psvelo. This PR allows the user to supply a CPT file and then use one of many criteria to look up the corresponding color. These are the improvements:

  1. Accept a CPT file via new option -C.
  2. New option -Z sets which attribute of the data (magnitude, specific component, or a user column) should be used to assign the color [Default is magnitude, i.e. vector magnitude or rotation].
  3. Modifier +e to -Z switches the coloring from the symbol fill (i.e., -G domain) to the error part (i.e., -E), allowing the error ellipse or rotation uncertainty to be colored based on the error estimates (uncertainty in magnitude, rotation, etc.).
  4. Allow -L to also append an optional secondary pen for the error symbol outlines [Default is same pen as -W].
  5. Both -L and -W inherit the +cl|f modifer used in plot to assign CPT color to fills, pens, or both.

I have added a new tests exploring most of the combinations of color and fill; here is what the plot looks like:

geodesy_07

@PaulWessel PaulWessel self-assigned this Mar 4, 2021
@PaulWessel PaulWessel merged commit afe2d47 into master Mar 4, 2021
@PaulWessel PaulWessel deleted the velo-color branch March 4, 2021 22:06
weiji14 added a commit to lhoupert/pygmt that referenced this pull request Apr 5, 2021
Update docstring to include new options in `velo`
from the upcoming GMT 6.2.0 that were added in
GenericMappingTools/gmt#4970,
GenericMappingTools/gmt#4901, and
GenericMappingTools/gmt#4907.
Removed the default vector="+p1p+e" argument, and
formatted docstring to have nested lists to be nicer looking.
weiji14 added a commit to GenericMappingTools/pygmt that referenced this pull request Apr 30, 2021
Add `velo` function for plotting velocity vectors, crosses, anisotropy
bars, and wedges. Original GMT velo function can be found at
https://docs.generic-mapping-tools.org/6.1/supplements/geodesy/velo.html

* clarify the type of data input
* raise error if alias S is not defined
* Refactor velo to use virtualfile_from_data and add three more unit tests
* Alias panel (c) for velo, and lightly edit some docstrings
* Alias scale (H), intensity (I) and zvalue (Z) from GMT 6.2.0

Update docstring to include new options in `velo`
from the upcoming GMT 6.2.0 that were added in
GenericMappingTools/gmt#4970,
GenericMappingTools/gmt#4901, and
GenericMappingTools/gmt#4907.
Removed the default vector="+p1p+e" argument, and
formatted docstring to have nested lists to be nicer looking.

* Fix typos and add intersphinx mappings
* Update the frame, region, projection and color of velo example
* Rename alias intensity for -I to shading
* Rename alias facecolor for -G to color
* Move docstring for projection (J) and region (R) up a bit
* Rename alias to spec (S) and update baseline images for GMT 6.2.0rc1
* Mark fig.velo tests with xfail
* Rename alias uncertainty_color to uncertaintycolor for parameter E
* Move velo_arrow_ellipse.py under "Seismology and Geodesy" category

Co-authored-by: Wei Ji <23487320+weiji14@users.noreply.github.com>
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Co-authored-by: Michael Grund <23025878+michaelgrund@users.noreply.github.com>
Co-authored-by: Meghan Jones <meghanrjones@users.noreply.github.com>
sixy6e pushed a commit to sixy6e/pygmt that referenced this pull request Dec 21, 2022
Add `velo` function for plotting velocity vectors, crosses, anisotropy
bars, and wedges. Original GMT velo function can be found at
https://docs.generic-mapping-tools.org/6.1/supplements/geodesy/velo.html

* clarify the type of data input
* raise error if alias S is not defined
* Refactor velo to use virtualfile_from_data and add three more unit tests
* Alias panel (c) for velo, and lightly edit some docstrings
* Alias scale (H), intensity (I) and zvalue (Z) from GMT 6.2.0

Update docstring to include new options in `velo`
from the upcoming GMT 6.2.0 that were added in
GenericMappingTools/gmt#4970,
GenericMappingTools/gmt#4901, and
GenericMappingTools/gmt#4907.
Removed the default vector="+p1p+e" argument, and
formatted docstring to have nested lists to be nicer looking.

* Fix typos and add intersphinx mappings
* Update the frame, region, projection and color of velo example
* Rename alias intensity for -I to shading
* Rename alias facecolor for -G to color
* Move docstring for projection (J) and region (R) up a bit
* Rename alias to spec (S) and update baseline images for GMT 6.2.0rc1
* Mark fig.velo tests with xfail
* Rename alias uncertainty_color to uncertaintycolor for parameter E
* Move velo_arrow_ellipse.py under "Seismology and Geodesy" category

Co-authored-by: Wei Ji <23487320+weiji14@users.noreply.github.com>
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Co-authored-by: Michael Grund <23025878+michaelgrund@users.noreply.github.com>
Co-authored-by: Meghan Jones <meghanrjones@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants