Skip to content

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

Merged
seisman merged 17 commits into
GenericMappingTools:masterfrom
willschlitzer:colorbar-shading
Dec 22, 2020
Merged

seisman merged 17 commits into
GenericMappingTools:masterfrom
willschlitzer:colorbar-shading

Conversation

@willschlitzer

Copy link
Copy Markdown
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

seisman commented Dec 19, 2020

Copy link
Copy Markdown
Member

@willschlitzer

Copy link
Copy Markdown
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

seisman commented Dec 20, 2020

Copy link
Copy Markdown
Member

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

seisman commented Dec 20, 2020

Copy link
Copy Markdown
Member

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
Copy Markdown
Contributor Author

Sounds good, I'll work on this tomorrow

@weiji14 weiji14 added the enhancement Improving an existing feature label Dec 21, 2020
Comment thread pygmt/base_plotting.py Resolved
Comment thread pygmt/base_plotting.py Resolved
@seisman seisman added this to the 0.3.0 milestone Dec 22, 2020
Co-authored-by: Dongdong Tian <[email protected]>
Co-authored-by: Dongdong Tian <[email protected]>
Comment thread pygmt/tests/test_colorbar.py Resolved
Comment thread pygmt/tests/test_colorbar.py Resolved
Comment thread pygmt/tests/test_colorbar.py Resolved
Comment thread pygmt/base_plotting.py Resolved

This branch was previously deployed

1 inactive deployment
Preview — f5170ed5 Deployed Dec 22, 2020 by vercel[bot]
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