-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Documentation of fontdict #10293
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
Comments
Answer to 1) is pretty clearly "any kwarg to Text" and to 2) is probably "because no one complained about the redundant API" (seems to have come in very early, in e34a333). |
Thanks for the reply. So this is 'historic'. Is there a benefit from using If not, should this be deprecated for removal in 3.0?
|
Are all the extra kwargs passed through? Umm, OK, I'm dumb, but how do I mix a kwarg dictionary with bare kwargs? i.e. |
|
Certainly we'd want to have lots of examples of this, because I don't think a lot of users know this syntax. |
It looks like I'm not sure that removing the fontdict kwarg itself is a good idea, however. In various text calls one might want a common font-related properties in a single dictionary, and other kwargs in another dictionary. Only one of them can be supplied via I'm not unalterably opposed to deprecating fontdict over several--not just one--release cycles, but I need some convincing. |
I think we should also consider the opposite route of requiring text kwargs to be passed in their own dict (as mentioned by @efiring the organization it provides it worthwhile). Of course this goes back to the general issue of mpl's use of kwargs throughout to set properties through the entire call stack. |
I've often found myself confused how to specify font properties and have to look it up. And then some properties can be set by keyword and others (I think) need to be provided in An would be to have a |
See #10249 for a writeup/todo on font properties... |
@anntzer I don't think "requiring text kwargs to be passed in their own dict" is a good idea. It would significantly clutter simple use cases, in particular in pyplot
For the moment, I will just document the current state, that |
To muddy the waters a bit, @efiring, that behavior about unpacking multiple dicts for kwargs has indeed changed in Python 3, which coincidentally we're about to be able to start using: def foo(**kwargs):
print(list(kwargs))
d1 = dict(a=1, b=2)
d2 = dict(c=3, d=4)
foo(**d1, **d2) yields
I'm not sure if that affects any arguments. |
Indeed, multiple dicts reduce the benefit of an explicit
This can then be written as:
Under these circumstances I vote for deprecating and removing the explicit fontdict parameter in the long run. I don't see any need for it and the interface stays simpler. |
This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help! |
At least discouraging the use of fontdict seems reasonable here. |
Closes matplotlib#10293. `fontdict` is redundant API, but it's not bad enough to justify the user hassle of a deprecation. By discouraging we point the users away from `fontdict` so that the somewhat messy documentation state of `fontdict` is less of a concern.
Closes matplotlib#10293. `fontdict` is redundant API, but it's not bad enough to justify the user hassle of a deprecation. By discouraging we point the users away from `fontdict` so that the somewhat messy documentation state of `fontdict` is less of a concern. Co-authored-by: hannah <story645@gmail.com>
Closes matplotlib#10293. `fontdict` is redundant API, but it's not bad enough to justify the user hassle of a deprecation. By discouraging we point the users away from `fontdict` so that the somewhat messy documentation state of `fontdict` is less of a concern. Co-authored-by: hannah <story645@gmail.com>
While working on the docs, I've found a
fontdict
parameter on multiple pyplot functions such asxlabel
,text
,title
etc.I've not found a concise documentation which values are supported here.
family, color, weight, size
fontsize, fontweight, verticalalignment, horizontalalignment
Questions:
Text
object, which can already be achieved by kwargs.The text was updated successfully, but these errors were encountered: