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

Add the shading parameter to colorbar() in base_plotting.py #752

Merged
merged 17 commits into from
Dec 22, 2020

Conversation

willschlitzer
Copy link
Contributor

As mentioned in #749, this adds the shading alias/parameter to pygmt.Figure.colorbar.

I'm not familiar with how shading will affect the color bar, other than that it makes it look different and darker, so I left a pretty vague description for it under the parameter list.

@seisman
Copy link
Member

seisman commented Dec 19, 2020

@willschlitzer
Copy link
Contributor Author

Didn't think to check the GMT docs on this one; copied the text from the GMT docs and changed the arguments to string or boolean

@seisman
Copy link
Member

seisman commented Dec 20, 2020

Hi @willschlitzer more work needs to be done here.

So the possible values of the shading (-I) option are:

  • bool: shading=True or shading=False
  • a single value. for example shading=0.8 means -0.8 to 0.8
  • low/high, for example shading="-0.3/0.8".

For case 3, it would be better if we can also support shading=[-0.3, 0.8], just like we can use region="0/10/0/10" and region=[0, 10, 0, 10].

@seisman
Copy link
Member

seisman commented Dec 20, 2020

For case 3, it would be better if we can also support shading=[-0.3, 0.8]

To implement the feature, you need to add I="sequence" to @kwargs_to_strings.

@willschlitzer
Copy link
Contributor Author

Sounds good, I'll work on this tomorrow

@weiji14 weiji14 added the enhancement Improving an existing feature label Dec 21, 2020
pygmt/base_plotting.py Outdated Show resolved Hide resolved
pygmt/base_plotting.py Outdated Show resolved Hide resolved
@seisman seisman added this to the 0.3.0 milestone Dec 22, 2020
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
pygmt/tests/test_colorbar.py Outdated Show resolved Hide resolved
pygmt/tests/test_colorbar.py Outdated Show resolved Hide resolved
pygmt/tests/test_colorbar.py Outdated Show resolved Hide resolved
willschlitzer and others added 3 commits December 22, 2020 09:15
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
pygmt/base_plotting.py Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improving an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants