-
Notifications
You must be signed in to change notification settings - Fork 14
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
new label_placer implementation #23
Comments
Thanks for your comments. Just so I fully understand: Is there a specific request for a code change you're making? I provided the ability to add custom label placers because I was expecting that different people would have different requirements for where labels should go. If the question is whether I'd consider adding this label placer to the code base, I'm open to that in principle. Feel free to open a PR and we can go from there. |
Hi @clauswilke. Thanks for the quick response. I'm going to open a PR for my |
Feel free to try it out. I haven't thought about this problem in a long time and honestly don't really remember how the function works. In my opinion, it's a good idea to have a collection of different label placers, as they they may all have different use cases. So I'm happy to add your label placer, and I would keep the current minmax label placer as is, but I'd also be happy to add a variation of the minmax label placer that adds additional constraints. |
Hi everyone,
First of all congratulations for this wonderful package. I have been using it for a couple of years with the package ggisoband and it has been very useful to me.
Yesterday I started to use the
isolines_grob()
function but I didn't get good results. The main proplem was the labels position calculated with the label_placer_minmax() function. Probably, it is a good function for many plots but when I use this function in my data a lot of labels are positioned at the plot margins. It would be very useful to add to this type of functions the possibility of evaluating how far we are from the margin of the graph. This would prevent this type of problem by moving the labels away from the margins.My solution was to define a new
label_placer()
function.This function evaluates each line and it considers the different id subdivisions. Then it positions the label in the middle of each subdivision. Finally, the theta angle is calculated as in function
label_placer_minmax()
.The text was updated successfully, but these errors were encountered: