-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The return in 2d: Why do labels move that are not overlapping? #51
Comments
Right, yeah, somehow gridspec messes with adjust_text if there is more than one subplot created that way. See below.
The same code with uncommented lines to create additional axes: |
Or perhaps I can get @tacaswell to share some helpful comment here? :) I am a bit at a loss what is going on. |
Unfortunately, such dense plots are very difficult to optimize... A very small force and many iterations is your best bet, and probably reducing the expand_text too.
|
Yeah, someone has already suggested this "importance" feature with removing less important annotations before. I need to think how to best implement this kind of behaviour. Yeah, for crossing arrows I saw that in |
Yes, that already looks much better. What are the settings? You just made the space go to -10? I'll try that... |
Yeah, just -10. This looks even better I think, although takes a long time:
|
Wonderful! Thanks a lot! |
Try forcing a draw before you call |
@tacaswell Thanks! Just simply adding |
Hi @kimgerdes I found an easy solution. Still don't know why this doesn't work by default, but adding |
Thanks for having looked into that! It's nice that the side graphs can be preserved this way.
So our favorite mode would be one where
This would give something like
If you have any idea how that could be achieved, that would be great. |
I see.
|
So, I did make a minor fix to autoalignment, not that it makes a huge difference, but this is th kind of plot that I get now with this code.
Not much can be done to improve the really dense area on the left bottom, but I think it looks very reasonable with most texts very close to the dots... |
Thanks for this quick fix!
That would be great. |
I suppose the example you show is something related to my suggestion in 3, but I don't understand why this happens, and so I wouldn't rely on this behaviour. |
Great, thanks! |
So, I quickly tried adding a bigger axes to contain the texts... This kind of works, but somehow the whole algorithm doesn't really do its job very well.
|
There is a chance it'll be implemented soon, but no guarantee! :) Sorry. |
yes, now some labels are right on the dots. And some have gray lines although they are spot on (Estonian, Armenian,...). and on the max side, some space could be added as well. |
Yeah, I need to dig into the algorithm and think about transforms and so on... I guess I have to transform the coordinates of the dots into the new axes. |
This is an extension of issue #50
The main graphs that we'll be using in our paper are 2-dimensional. Maybe there is something that can be done with adjustText here, too:
So the unadjusted scatter plot is
adjustText gives me
Again, labels are moving that shouldn't. Moreover, some labels are moved right on top of other points. Below is the complete code. You can see a few commented out variables in the adjust_text call that I have experimented with, but they don't seem to make any difference.
Do you have any idea of parameter settings that would give a better uncluttering?
Ideally, one should be able to specify a maximum distance from the original position, and then an option would allow to remove remaining overlapping labels until only non-overlapping remain 😄
The text was updated successfully, but these errors were encountered: