Search code examples
matplotlib

How to align end of texts or annotations in matplotlib?


I would like to achieve the following figure I can easily realize in gnuplot but, this time, using matplotlib :

enter image description here

On the right side (here "Recettes"), after reading the documentation, I am confident I can do it easily.

But on the left side, I have to align the ends of the textes and I cannot see any parameters in annotate() or text() function to achieve this. Any idea would be welcome.


Solution

  • You can specify horizontalalignment or ha with one of these [ ‘center’ | ‘right’ | ‘left’ ] as one of the keyword arguments (**kwargs).

    See ref here.