Open lgpage opened 11 years ago
Shall we move this to 4.0?
Let me first see how far I can get with this in the next week before moving it to v4.0
anyone know of an easy way to test if two matplotlib
text
objects overlap?
I have a solution in mind, but it will require some coding, so If you know of a simple solution please let me know.
You can get the bounding box for each and then check the minimum and maximum values I think.
On Wed, Oct 23, 2013 at 5:04 PM, lgpage notifications@github.com wrote:
anyone know of an easy way to test if two matplotlib text objects overlap? I have a solution in mind, but it will require some coding, so If you know of a simple solution please let me know.
— Reply to this email directly or view it on GitHubhttps://github.com/ibell/coolprop/issues/56#issuecomment-26912586 .
I tried looking into the bounding box of the text, unfortunately I cannot make heads or tails of the transform object that gets applied to the text and bbox. All I've been able to get is the local transform bounds between 0 and 1. For now I'll carry on with the solution I have in mind and see what I can come up with.
This is turning out to be more of a fight that I thought. I can have a manual label placement method done for v4.0, but I doubt that I'll be able to get an optimized label placement method (to minimize overlapping) done.
In-line Labels for iso-lines are currently broken. Checklist for this:
get in-line label code to work(removed old code - e10d463c9bedda8a4d82d8dfc7c9240e92e03749)clean up current code(removed old code - e10d463c9bedda8a4d82d8dfc7c9240e92e03749)add basic in-line labels that rotate with the line gradient(e6e89c3266934d4104e65cfac5134768228303c7)(c299093fb69767a528ce7a4a48077b4509e6425b)center
: place labels strictly centered below one another, nearest the a given x-coordinate(c299093fb69767a528ce7a4a48077b4509e6425b)manual
: place labels strictly nearest the given x-coordinates (one for each line)auto
: float / adjust the label placements to minimize overlap, nearest the given x-coordinatepyplot
: useContourSet
andclabel
methods frommatplotlib.pyplot