0

I am using this example https://towardsdatascience.com/the-easiest-way-to-create-an-interactive-dashboard-in-python-77440f2511d1 but trying to use plotly method fig.update_xaxes(exponentformat='SI') to change the tickformat on x axis of the interactive hvplot. I have tried ihvplot.opts (layout = l) where l is a layout object of the type and ihv is interactive hvplot as described in the example linked above

Layout({
    'autosize': False,
    'height': 300,
    'margin': {'b': 50, 'l': 50, 'pad': 4, 'r': 50, 't': 50},
    'template': '...',
    'title': {'text': ''},
    'uirevision': True,
    'width': 700,
    'xaxis': {'automargin': False,
              'exponentformat': 'SI'}
})

but no luck. Is there anyway to update 'xaxis' in the interactive hvplot?

user15420598
  • 107
  • 7
  • seems like using default templates is a workaround. Assuming you have a fig object that has the layout just the way you want it, you can use it as a default for plotly figure initialization which works with hvplot . Set default before calling hvplot use templates for default SI x axis import plotly.graph_objs as go import plotly.io as pio templated_fig = pio.to_templated(fig) pio.templates['x axis SI'] = templated_fig.layout.template pio.templates.default = 'x axis SI' – user15420598 May 15 '22 at 22:34
  • correction was missing setting up figure properties templated_fig = pio.to_templated(go.Figure().update_xaxes(exponentformat="SI")) #type="log" – user15420598 Jul 30 '22 at 14:21

0 Answers0