API: change default 'align' for bar and barh#7172
Merged
efiring merged 3 commits intomatplotlib:v2.xfrom Sep 25, 2016
Merged
Conversation
efiring
requested changes
Sep 25, 2016
Member
efiring
left a comment
There was a problem hiding this comment.
Looks good after tiny tweaks.
doc/users/dflt_style_changes.rst
Outdated
|
|
||
| def demo(bar_func, bar_kwargs): | ||
| return bar_func([1, 2, 3], [1, 2, 3], tick_label=['a', 'b', 'c'], | ||
| ,**bar_kwargs) |
doc/users/dflt_style_changes.rst
Outdated
| demo(ax4.barh, {'align': 'edge'}) | ||
|
|
||
|
|
||
| To restore the previous default explicitly pass a value for ``align='edge'`` to the |
doc/users/dflt_style_changes.rst
Outdated
|
|
||
| The default value of the ``align`` kwarg for both | ||
| `~matplotlib.Axes.bar` and `~matplotlib.Axes.barh` is changed to | ||
| ``'center'`` from ``'edge'``. |
Member
There was a problem hiding this comment.
Nit: this would read more smoothly with the reversed order, "from center to edge".
Member
|
Travis docbuild also caught the extraneous comma. |
Change from 'edge' to 'center'
687729d to
c148057
Compare
Member
Author
|
@efiring fixed and force-pushed |
QuLogic
reviewed
Sep 25, 2016
| import matplotlib.pyplot as plt | ||
| import numpy as np | ||
|
|
||
| fig, ((ax1, ax2), (ax3, ax4)) = plt.subplots(2, 2, figsize=(5, 5)) |
Member
There was a problem hiding this comment.
Why put this before the function?
Member
Author
There was a problem hiding this comment.
No particular reason. A bunch of the example on this page page this ordering.
doc/users/dflt_style_changes.rst
Outdated
| demo(ax4.barh, {'align': 'edge'}) | ||
|
|
||
|
|
||
| To restore the previous default explicitly pass a the kwarg |
Member
There was a problem hiding this comment.
a the?
And I would spell out the whole words.
| ax1.plot(np.arange(10), np.arange(10), 'x', | ||
| np.arange(10) + 1, np.arange(10), 'o') | ||
| ax2.bar(np.arange(10), np.arange(10)) | ||
| ax2.bar(np.arange(10), np.arange(10), align='edge') |
Member
There was a problem hiding this comment.
It's not quite "default" edges now... Not strictly necessary to update, though.
efiring
approved these changes
Sep 25, 2016
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change from 'edge' to 'center'