Bug report
Bug summary
horizontalalignment = 'left' aligns the title on the right, horizontalalignment = 'right' aligns a short title on the left, horizontalalignment = 'right' displaces a longer title on the far left
Code for reproduction
# Left alignment test, short title
fig = plt.figure(figsize=(9,4))
ax = fig.add_subplot(111)
fig.suptitle('This figure suptitle should be on the left', horizontalalignment = 'left')
ax.set_title('This axis title should be on the left', loc='left');
fig.savefig('left_align.png')
# Right alignment test, short title
fig = plt.figure(figsize=(9,4))
ax = fig.add_subplot(111)
fig.suptitle('This figure suptitle should be on the right', horizontalalignment = 'right')
ax.set_title('This axis title should be on the right', loc='right');
fig.savefig('right_align.png')
# Right alignment test, longer title
fig = plt.figure(figsize=(9,4))
ax = fig.add_subplot(111)
fig.suptitle('This figure suptitle should be on the right but it is far left', horizontalalignment = 'right')
ax.set_title('This axis title should be on the left', loc='left')
fig.savefig('far_left.png');
Actual outcome
-
Left alignment test, short title

-
Right alignment test, short title

-
Right alignment test, longer title

Expected outcome
The following code manually sets the figure title at the expected position:
fig = plt.figure(figsize=(9,4))
ax = fig.add_subplot(111)
fig.suptitle('This figure suptitle is long but it is manually positioned', x = 0.38)
ax.set_title('This axis title should be on the left', loc='left')
fig.savefig('manual_pos.png');
Which gives:

Matplotlib version
- Operating system: Windows
- Matplotlib version: 2.1.2 and 2.2.3
- Matplotlib backend: agg
- Python version: 3.6.4
- Jupyter version: 4.4.0
Bug report
Bug summary
horizontalalignment = 'left'aligns the title on the right,horizontalalignment = 'right'aligns a short title on the left,horizontalalignment = 'right'displaces a longer title on the far leftCode for reproduction
Actual outcome
Left alignment test, short title

Right alignment test, short title

Right alignment test, longer title

Expected outcome
The following code manually sets the figure title at the expected position:
Which gives:

Matplotlib version