|
From: Florian M. W. <wag...@st...> - 2014-03-17 13:31:51
|
Dear users,
I would like label my subplots with a horizontally left-aligned letter
(wanted by the journal) and the normal, centered axes title, which
should both be vertically in line. The following example does not work:
from matplotlib import pyplot as plt
import numpy as np
fig, ax1 = plt.subplots()
x = np.linspace(1,10)
y = (sin(x))
ax1.plot(x,y)
def subplot_label(ax, letter, title):
title = ax.set_title(title)
pos = title.get_position()
va = title.get_va()
ax.text(0, pos[1], letter, transform=ax.transAxes,
verticalalignment=va)
subplot_label(ax1, 'a)', 'This text is not aligned with the label')
Which property of the axes title am I missing?
Thank you for your help
|