Plotly Chart-Studio config parameter to change Modebar in Python

I’ve created a simple Plotly chart in Python, and I can change the Modebar options quite easily. However, when I’m trying to publish the same chart to Chart-Studio, not all the Modebar configurations are working. Any ideas?

Here is the code:

import pandas as pd
import numpy as np
import plotly.graph_objects as go

df = pd.DataFrame({'a':[2,4,6,8,10],'b':[3,6,9,12,15]})

fig = go.Figure()
fig.add_trace(go.Scatter(x=df.index, y=df['a'], mode='lines', name='a', line=dict(color='dodgerblue', dash='solid')))
fig.add_trace(go.Scatter(x=df.index, y=df['b'], mode='lines', name='b', line=dict(color='lightsalmon', dash='dash')))

    title='a and b',
    newshape=dict(line_color='mediumaquamarine', line_width=2, opacity=1)

config = {
    'modeBarButtonsToAdd' : ['drawline', 'drawopenpath', 'drawrect', 'eraseshape'],
    'displaylogo'         : False

The figure that appears has the logo removed and the additional buttons on the modebar showing as it should…

However, if I try to publish this to Chart-Studio:

import chart_studio.plotly as py
import chart_studio'xxxxx', api_key='#####')

py.plot(fig, filename='a and b', auto_open=False, config=config)

This doesn’t work. Note, the logo doesn’t appear so I thought that part was working, but actually if I turn displaylogo=True then it doesn’t show the logo either. So it appears none of the config arguments are working.

I’m not sure if this is exactly the way to update config in Chart-Studio but I can’t find any documentation for it, I tried this based on this old post:

Adding config modes to Plotly.Py offline - modebar

I also tried saving the fig file with the config argument and publishing that but that gives an error. What I’ve tried here doesn’t give an error but it doesn’t do anything.


I encountered the same problem. The modebar changed locally only.

I’m encountering the same issue. Did either of you ever find a solution, @zakzola, @chenfafa?

Hy! I know this is an old thread. But as far as I can manage it by change the color in JSON tab. Work fine to me.
Json tab > Tree > Figure > layout > modebar then change it to rgba and set the alpha to 0.

modebar		{4}
orientation	:	h
bgcolor	:		rgba(255, 255, 255, 0)
color	:		rgba(68, 68, 68, 0)
activecolor	:		rgba(68, 68, 68, 0)