-
-
Notifications
You must be signed in to change notification settings - Fork 261
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
Enhance add_sorted_driver_legend #621
Conversation
I agree with passing args and kwargs through to Matplotlib. We should do that. But I do not agree with ensuring uniqueness. Matplotlib's |
The docstring also needs entries for args and kwargs then |
I thought about this a bit more, and I think I see what you were aiming for in general. You are right that there is not enough customizability here right now. |
When you call I will add args and kwargs to the docstring @theOehrly I saw you merge the new plotting module but no version has been released yet, how could I use the latest version of the plotting module? |
Maybe this will not be the best solution for the future but for now is a very good solution and I need to customize the legend to adapt my code to the new plotting module. I would like to use the new plotting module in Belgium |
The problem with that is that there should be API consistency. Changing the behaviour and function signature should be done with proper deprecation cycles, and those are slow. Therefore, I'd like to not need to touch this again soon. I'll take the liberty to push a change to this branch and then merge (today or tomorrow). After the change, the function signature will behave exactly as My reasons for not doing deduplication in this function are that first, it might be surprising to other users because it doesn't match Matplotlib's behaviour. Second, if we do deduplication, there's no way around it. People cannot opt-out except if we add yet another argument and make the signature even more different from |
The release will be tomorrow if I managed to verify and create a release with both Ergast and the F1 Livetiming API having problems right now. |
It would be useful if the function fastf1.plotting.add_sorted_driver_legend(ax, term) included the same arguments as the Matplotlib function ax.legend(), such as loc, fontsize...
Another improvement would be to ensure a unique list of labels