Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Consider removing column name and = sign in legend #36
Hi again @nicolaskruchten,
Something that puzzled me about the
Also, for personal taste, I think equal sign does not play well outside equations and prefer
Happy to discuss with you about it. Maybe there is an option that can disable it, that I am not aware of.
Thanks for the input!
This is the best compromise I could find at the moment for dealing with cases where in fact it's not easy to infer from the value (i.e. the values are "Yes" and "No" and the column is called "Smoker" etc) and because when you are using colours and symbols, you need to be able to differentiate which is which ("smoker=Yes, child=Yes" vs "Yes, Yes").
The best way to deal wit this would be to have separate legends for color, symbol, size and line-dash, with titles, but plotly.js doesn't (yet) support this kind of thing.
In terms of how to actually get the effect you want, unfortunately you'll have to iterate through the traces and change the names. We're looking at various ways to make that easier: plotly/plotly.py#1484
Hi @nicolaskruchten eventually I found the time to reply!
From my experience, such ambiguity would be limited as the graph would come with a title s.a evolution by smoking behaviour. But I hadn't realized you could have composed categories, in this case, I understand that might be tricky.
If you just want to show the values in legend, you can use this:
like if you have something like:
so the below snippet will remove the "alert_role" and will show only values like cpu, clone,memory etc:
The output will be:
Love the update to the legend in 4.5! Now I'm wondering if there's a way to supress the '=' expression from the titles of sub-plots. or if not, is there a helper function like there used to be for traces, something like:
for_each_subplot( lambda z: z.update(title=z.title[(z.title.find("=")+1):]))