Skip to content

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

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

Add the shading parameter to colorbar() in base_plotting.py#752
seisman merged 17 commits intoGenericMappingTools:masterfrom
willschlitzer:colorbar-shading

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
@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>
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>
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