Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to align end of texts or annotations in matplotlib?

Tags:

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.

like image 762
meaulnes Avatar asked Mar 09 '23 04:03

meaulnes


1 Answers

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

like image 127
swatchai Avatar answered Mar 12 '23 05:03

swatchai