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
We will soon have LineCollection so we should probably add a class attribute to each Graphic subclass which is used by Plot when attaching all the graphic names as methods, since we'd want plot.line_collection() rather than plot.linecollection() and it maintains pep8 standards
It would be useful for Subplot.get_graphics() to return a dict instead of a list, where the keys are the object class.
example:
fromfastlotlib.graphicsimportImageGraphicgraphics_in_subplot=gp[0, 0].get_graphics()
graphics_in_subplot[ImageGraphic] # list of all `ImageGraphic` graphic instances within the subplot
I think it'd be useful to use the __init_subclass__ to parse Graphic class names automatically and set it as a class attribute that can be used for this purpose, but also for attaching the various add_graphic-name methods, so we can have this parsing code in just one place.
This would also make it so that the dict keys for this PR are str, I think str is better since then the user doesn't need another set of import statements for graphic objects.
Activity
clewis7 commentedon Dec 13, 2022
I like this idea! I can work on making
Subplot.get_graphics()return a dict instead of a listkushalkolar commentedon Dec 17, 2022
I think it'd be useful to use the
__init_subclass__to parse Graphic class names automatically and set it as a class attribute that can be used for this purpose, but also for attaching the various add_graphic-name methods, so we can have this parsing code in just one place.This would also make it so that the dict keys for this PR are str, I think str is better since then the user doesn't need another set of import statements for graphic objects.
kushalkolar commentedon Jan 2, 2023
printing it out like a table or just with nice tabspacing would be nice: