ppinard / matplotlib-colorbar

Provides a new artist for matplotlib to display a colorbar
BSD 2-Clause "Simplified" License
7 stars 3 forks source link

Add functions to customize tick position and labels #1

Closed jnth closed 8 years ago

jnth commented 8 years ago

Hi,

Great library, thanks for sharing this.

I add two functions to your library to customize tick position and labels. I add tests for these new functions at the same time.

ppinard commented 8 years ago

Hi, thank you for your contribution! Custom tick positions and labels were indeed missing.

I am just wondering whether we should set the tick positions as in matplotlib's official colorbar. See http://matplotlib.org/api/colorbar_api.html#matplotlib.colorbar.ColorbarBase.set_ticks. So instead of your set_ticksteps function (taking values from 0.0 to 1.0), there should be a set_ticks function which takes real data values. I don't know which one is better? What is your experience on this?

P.S. This is just for discussions. I can accept the pull request and open a new enhancement issue.

jnth commented 8 years ago

You're right. It will be better and consistent with the matplotlib function. Give me a few days to propose you a new PR.

jnth commented 8 years ago

Here is my new PR to use tick values.

ppinard commented 8 years ago

Merged and version 0.2.0 is uploaded to PyPi