Hi, I can’t figure out how to label the bars in a Makie waterfall chart anymore. It used to be possible to pass all barplot options to waterfall(...), e.g. the following code used to run. Since updating I now have to comment out the bar_labels option. Any idea what to do?
There were some changes to disallow unknown attributes, even though some recipes might have just forwarded these to their children. But it led to unintended consequences too often. These attributes you’re setting have not been added specifically to waterfall so they are rejected. They could be added again, though, you’re welcome to file a PR to that effect.
A workaround would be to plot the waterfall, then access wf.plots which contains the underlying barplot. On this, you should be able to set the desired attributes. So something like wf.plots[i_barplot].bar_labels = ...
Thanks! But unfortunately I still can’t get this to work. Maybe I am missing something.
If I call wf=waterfall(...,
then I can manually set wf.plot.plots[1].bar_labels = mybarlabels, and this doesn’t throw an error, but the final chart doesn’t show any labels on the bars.
Ah I see, the problem is that the barplot recipe adds the text plot for the labels only if at creation, bar_labels !== nothing. So you’re too late basically. Ideally such things would be dynamic as well but Makie tends to not implement dynamic plot addition/removal in recipes because it’s a bit finicky. The best thing would be to just add these attributes to waterfall, I’d welcome a PR to that effect.
Other than that, here’s a workaround. We just create the waterfall, then delete it again but re-plot the inner barplot using the attributes and args that waterfall created. But there we can add the bar_labels attribute: