I am using matplotlib to generate an SVG plot containing a mixture of Annotations and Circles. I noticed that the annotation text does not appear at exactly the correct location when outputting to SVG. The difference is minor, but definitely present.

The following will reproduce the problem in the form of two files, an svg and a png:

from matplotlib.pyplot import figure
from matplotlib.text import Annotation
from matplotlib.patches import Circle
from matplotlib.transforms import IdentityTransform

f = figure(1)
a = f.add_subplot(111)
text = Annotation('H', (0.4, 0.4), va='center', ha='center', size='xx-large', transform=IdentityTransform())
IdentityTransform() is used to workaround a bug in add_artist() (see )

Further investigation reveals that this problem occurs with ps and pdf output as well. It seems that all backend_*.py files in /usr/share/pyshared/matplotlib/backends suffer from this problem. I have poked around in a few files but can't see any obvious fixes.

Has anyone encountered this problem before and found a decent workaround?