Skip to content

Documentation of TextArea's fontprops keyword argument is misleading #12121

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

Closed
galenlynch opened this issue Sep 14, 2018 · 3 comments · Fixed by #12434
Closed

Documentation of TextArea's fontprops keyword argument is misleading #12121

galenlynch opened this issue Sep 14, 2018 · 3 comments · Fixed by #12434
Milestone

Comments

@galenlynch
Copy link
Contributor

galenlynch commented Sep 14, 2018

The documentation for TextArea strongly suggests that the keyword argument fontprops should be a FontProperties object. However, inspecting the source code suggests that fontprops should instead be a dictionary of keyword arguments that will be passed to the Text object inside TextArea.

I propose rewording the documentation to make it clear that fontprops should be a dictionary of keyword arguments.

@ImportanceOfBeingErnest
Copy link
Member

There are two options:

  1. Update the documentation with what the code does. (easy)
  2. Update the code such that it'll indeed also allow for FontProperties objects as input. Then update the documentation.

@galenlynch Any interest in making that change an submitting a pull request?

@timhoffm
Copy link
Member

timhoffm commented Oct 7, 2018

Actually, 1. is the way to go. The argument is correctly called textprops and passed as Text(..., **textprops). Thus FontProperties is just plain wrong.

@galenlynch
Copy link
Contributor Author

Sure, glad to make a PR with option 1.

galenlynch added a commit to galenlynch/matplotlib that referenced this issue Oct 7, 2018
As described in matplotlib#12121, the current documentation of `textprops` keyword
parameter strongly, and erroneously, suggests that `textprops` should be a
FontProperties object. In reality, it should instead be a dictionary of keyword
parameters that will be passed to the `Text` object inside of `TextArea`. This
commit changes the documentation to reflect the current behavior.

closes matplotlib#12121
galenlynch added a commit to galenlynch/matplotlib that referenced this issue Oct 7, 2018
As described in matplotlib#12121, the current documentation of `textprops` keyword
parameter strongly, and erroneously, suggests that `textprops` should be a
FontProperties object. In reality, it should instead be a dictionary of keyword
parameters that will be passed to the `Text` object inside of `TextArea`. This
commit changes the documentation to reflect the current behavior.

closes matplotlib#12121
@QuLogic QuLogic added this to the v3.1 milestone Oct 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants