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
As in the title. The documentation is somewhat ambiguous on this, but the example in the corresponding part of the documentation (here) suggests that the indexing should work on any sequence-like attribute on matplotlib objects. But this is not the case.
For some reason it is possible to index legend.get_texts()[0:1].fontsize but not axis.texts[0:2].size, even though the ArtistList at axis.texts is a perfectly fine sequence-like object.
I consider this a bug, because this feature is logically implied by the examples given in the docs and there seem to be no reason under the sun to allow for the first and prohibit the second.
I think that there is some too strict an instance check checking for being a subclass of list instead of a generic Sequence.
ALL software version info
holoviews=1.18.3 matplotlib=3.8.0
Description of expected behavior and the observed behavior
Mappings like "axis.texts.size": 24 should just work. Instead they fail with warnings like:
Encountered error: 'ArtistList' object has no attribute 'set_fontsize', or could not find 'set_fontsize' method on 'ArtistList' model. Ensure the custom option spec 'axis.texts[0:2].fontsize' you provided references a valid method on the specified model.
Complete, minimal, self-contained example code that reproduces the issue
# code goes here between backticks
import holoviews as hv
hv.extension("matplotlib")
plot = hv.Text(0, 1, "Text")
plot.opts(
backend_opts={
"axis.texts[:].size": 200
}
)
As in the title. The documentation is somewhat ambiguous on this, but the example in the corresponding part of the documentation (here) suggests that the indexing should work on any sequence-like attribute on matplotlib objects. But this is not the case.
For some reason it is possible to index
legend.get_texts()[0:1].fontsize
but notaxis.texts[0:2].size
, even though theArtistList
ataxis.texts
is a perfectly fine sequence-like object.I consider this a bug, because this feature is logically implied by the examples given in the docs and there seem to be no reason under the sun to allow for the first and prohibit the second.
I think that there is some too strict an instance check checking for being a subclass of
list
instead of a genericSequence
.ALL software version info
holoviews=1.18.3
matplotlib=3.8.0
Description of expected behavior and the observed behavior
Mappings like
"axis.texts.size": 24
should just work. Instead they fail with warnings like:Complete, minimal, self-contained example code that reproduces the issue
Stack traceback and/or browser JavaScript console output
Screenshots or screencasts of the bug in action
The text was updated successfully, but these errors were encountered: