Created
May 15, 2024 23:22
-
-
Save banditkings/b15f31b08721163739a0fe6731561342 to your computer and use it in GitHub Desktop.
Remove facet annotations from plotly
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def clean_annotations(fig): | |
"""Removes the annoying 'Feature=' label that clutters plotly graphs when you do facet_row or facet_col""" | |
fig.for_each_annotation(lambda a: a.update(text=a.text.split("=")[1])) | |
return fig |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
also, to have a plotly chart render on github/gitlab as a png but also stay interactive when working locally: