cphyc / matplotlib-label-lines

Label line using matplotlib.
MIT License
301 stars 28 forks source link

Adding option to offset y location #27

Closed andreamoro-git closed 3 years ago

andreamoro-git commented 3 years ago

Sometimes I don't want the label to cover the line. I have added an option to offset the location of labels by a given amount. I wrote a patch and submitted it as a git pull request.

cphyc commented 3 years ago

Closed by #26, thanks for the PR!

andreamoro-git commented 3 years ago

Can I suggest changing the following in the example code of the fourth chart to advertise the possibility (subplot 324 in the readme)

labelLine(l1, 0.6, label=r'$Re=${}'.format(l1.get_label()), ha='left', align=False, yoffset=.005, va='bottom', bbox={'alpha': 0})

andreamoro-git commented 3 years ago

Another good possibility is the yellow line in 326

cphyc commented 3 years ago

Done!