matplotlib-label-lines icon indicating copy to clipboard operation
matplotlib-label-lines copied to clipboard

ENH: Implemented y-axis-based labeling

Open pevoz23 opened this issue 2 years ago • 4 comments

Should close #121

pevoz23 avatar May 08 '23 15:05 pevoz23

Thanks for the implementation! This looks good overall, but I have slight concerns about backward compatibility. Also, would it be possible to add test(s) for this? To do so, please read pytest-mpl doc and add the reference image in labellines/baseline.

Note about tests: there is some tiny variation from one run to another on Github Action, leading to some tests failing. I haven't been able to troubleshoot it, but you can keep an eye on the tests results found in the artifacts of the runs.

Hey! Thanks for your review! I agree with all your comments and will work on them as soon as possible (likely in the next few days).

pevoz23 avatar May 12 '23 06:05 pevoz23

Just to bump, this would be a very useful feature if it could be included! Our use case is for labelling the chemical formulae of materials in phase diagrams (used in computational materials science research), and we have some smart algorithms for picking the label positions, but for vertical lines we can't set y so it always places the label at the y-midpoint which isn't always desirable (e.g. "P" here): image

image

kavanase avatar Aug 17 '24 18:08 kavanase

I'd be happy for someone to review the PR once the comments have been fixed (this one, or an offspring of it retaining authorship to @pevoz23) but I unfortunately do not have the time to do this myself.

cphyc avatar Aug 19 '24 09:08 cphyc