Search code examples
pythonmatplotlibtexttransformationaxes

Separate system of coordinates for x and y


I am using matplotlib for plotting in my project. I have a time series on my chart and I would like to add a text annotation. However I would like it to be floating like this: x dimension of the text would be bound to data (e.g. certain date on x-axis like 2015-05-04) and y dimension bound to Axes coordinates system (e.g. top of the Axes object). Could you please help me accomplish something like this?


Solution

  • It seems like I found the solution: one should use blended transformation: http://matplotlib.org/users/transforms_tutorial.html#blended-transformations