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 tick formatter plot options #3042

Merged
merged 4 commits into from Oct 5, 2018

Conversation

Projects
None yet
2 participants
@philippjfr
Copy link
Contributor

philippjfr commented Oct 3, 2018

Adds plot options to control the axis formatting directly rather than using the Dimension.value_format which only accepts formatter functions. These accept:

  • Format strings like '%d', '%.3f' etc.
  • Python functions which are compiled to JS with flexx (or converted to a FuncFormatter in mpl)
  • TickFormatter instances (or matplotlib.ticker.Formatter instances for mpl)
  • Add unit tests
  • Add documentation (to styling plots notebook)
Philipp Rudiger Philipp Rudiger

Philipp Rudiger added some commits Oct 4, 2018

@philippjfr

This comment has been minimized.

Copy link
Contributor Author

philippjfr commented Oct 5, 2018

@jlstevens Ready to review and merge once tests are passing.

Philipp Rudiger Philipp Rudiger

@philippjfr philippjfr force-pushed the add_formatter_options branch from 6441ccf to 9ad8fa6 Oct 5, 2018

@jlstevens

This comment has been minimized.

Copy link
Contributor

jlstevens commented Oct 5, 2018

Looks good!

I feel that maybe we should have used bokeh's PrintfTickFormatter earlier but better late than never! I'll merge once the push build is green.

@jlstevens jlstevens merged commit 89ca901 into master Oct 5, 2018

4 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.05%) to 83.204%
Details
s3-reference-data-cache Test data is cached.
Details
@philippjfr

This comment has been minimized.

Copy link
Contributor Author

philippjfr commented Oct 5, 2018

I feel that maybe we should have used bokeh's PrintfTickFormatter earlier but better late than never!

Definitely, I've never been able to give a good answer to questions about tick formatting.

@jlstevens

This comment has been minimized.

Copy link
Contributor

jlstevens commented Oct 5, 2018

Hmm, one thing...shouldn't matplotlib match the plot options here? (if possible)

@philippjfr

This comment has been minimized.

Copy link
Contributor Author

philippjfr commented Oct 5, 2018

Hmm, one thing...shouldn't matplotlib match the plot options here?

Aren't they matching?

@philippjfr philippjfr added this to the v1.11.0 milestone Nov 5, 2018

@philippjfr philippjfr deleted the add_formatter_options branch Nov 12, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.