Plotly Graph Title Issues

Has anyone else run into issues with the plotly titles and y and x axis titles not updating?

scatter = go.Bar(x = [feed_date for feed_date in feed_records[0]],
                         y = [feed_date for feed_date in feed_records[1]],
                         name = 'Feeding Records By Date')
    
    self.feed_graph.data = scatter
    self.feed_graph.layout.title = 'Feed Records By Prey Count'
    self.feed_graph.layout.xaxis.title = 'date'
    self.feed_graph.layout.yaxis.title = 'prey count'

This is giving me the below but according to the docs I would have thought it should be showing my titles and such.

You need to call self.feed_graph.redraw() after you assign your layout properties. As an efficiency measure, Plotly does not redraw the plot every time you modify its Python representation.

https://anvil.works/ide#clone:MTEGELEGDT4KEARU=DNGJCFE7CIR6K54VA2ARGOOS

2 Likes

Thanks again :slight_smile: