You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This bug is nearly identical to #12121, but affects AnchoredText instead of TextArea.
The documentation for AnchoredText strongly suggests that the keyword argument prop should be a FontProperties object. However, inspecting the source code suggests that prop should instead be a dictionary of keyword arguments that will be passed to the TextArea object inside of AnchoredText.
I propose rewording the documentation to make it clear that prop should be a dictionary of keyword arguments to construct the TextArea instance.
Perhaps it would be worthwhile to look over the documentation of other classes in offsetbox for similar issues, since this is the second time I've come across the same issue.
The text was updated successfully, but these errors were encountered:
galenlynch
changed the title
Documentation of AnchoredText's props keyword argument is misleading
Documentation of AnchoredText's prop keyword argument is misleading
Oct 9, 2018
Sure, judging from #12434 you already know how that would be fixed. So if you have the time, just go ahead (no need to open a new issue for each item you find).
Maybe I should make another issue for this, but it would be nice if TextArea and AnchoredText had a consistent API, maybe by renaming the prop argument of AnchoredText to be fontprops as is used by TextArea, which has the added benefit of being more descriptive.
It seems like it would be fairly easy to also support the old keyword, to prevent breaking people's code.
What's the attitude around here to such API changes? All things considered, it's a very minor complaint.
galenlynch
added a commit
to galenlynch/matplotlib
that referenced
this issue
Oct 9, 2018
`prop` should be a dictionary of keyword arguments that will be passed to the
`Text` object contained in `AnchoredText` (via `TextArea`). The current
documentation suggests that it should instead be a `FontProperties` object.
This commit changes the documentation to reflect the current behavior.
closesmatplotlib#12467
This bug is nearly identical to #12121, but affects
AnchoredText
instead ofTextArea
.The documentation for
AnchoredText
strongly suggests that the keyword argumentprop
should be aFontProperties
object. However, inspecting the source code suggests thatprop
should instead be a dictionary of keyword arguments that will be passed to theTextArea
object inside ofAnchoredText
.I propose rewording the documentation to make it clear that
prop
should be a dictionary of keyword arguments to construct theTextArea
instance.Perhaps it would be worthwhile to look over the documentation of other classes in
offsetbox
for similar issues, since this is the second time I've come across the same issue.The text was updated successfully, but these errors were encountered: