@@ -500,7 +500,7 @@ default. The default face color is now ``'C0'`` instead of ``'b'``.
500500 with rc_context(rc=rcparams):
501501 ax_top.pie(fracs, labels=labels)
502502 ax_top.set_aspect('equal')
503- ax_mid.bar(range(len(fracs)), fracs, tick_label=labels, align='center' )
503+ ax_mid.bar(range(len(fracs)), fracs, tick_label=labels)
504504 plt.setp(ax_mid.get_xticklabels(), rotation=-45)
505505 grid = np.mgrid[0.2:0.8:3j, 0.2:0.8:3j].reshape(2, -1).T
506506
@@ -529,6 +529,39 @@ or by setting::
529529
530530in your :file: `matplotlibrc ` file.
531531
532+ ``bar `` and ``barh ``
533+ ====================
534+
535+ The default value of the ``align `` kwarg for both
536+ `~matplotlib.Axes.bar ` and `~matplotlib.Axes.barh ` is changed from
537+ ``'edge' `` to ``'center' ``.
538+
539+
540+ .. plot ::
541+
542+ import matplotlib.pyplot as plt
543+ import numpy as np
544+
545+ fig, ((ax1, ax2), (ax3, ax4)) = plt.subplots(2, 2, figsize=(5, 5))
546+
547+ def demo(bar_func, bar_kwargs):
548+ return bar_func([1, 2, 3], [1, 2, 3], tick_label=['a', 'b', 'c'],
549+ **bar_kwargs)
550+
551+
552+ ax1.set_title('2.0')
553+
554+ ax2.set_title("classic alignment")
555+
556+ demo(ax1.bar, {})
557+ demo(ax2.bar, {'align': 'edge'})
558+ demo(ax3.barh, {})
559+ demo(ax4.barh, {'align': 'edge'})
560+
561+
562+ To restore the previous behavior explicitly pass the keyword argument
563+ ``align='edge' `` to the method call.
564+
532565
533566Hatching
534567========
0 commit comments