Y-acis shifting not working

The above code should shift the y axis of the plot py some pixels, but it is not doing so.
Any idea why?

import plotly.graph_objects as go


# Figure
fig = go.Figure()   # width=800, height=400

# Layout
fig.layout.update(dict(
    showlegend = False,
    margin = {"l": 50,
              "r": 50,}
))

# Axes
#x axes
fig.layout['xaxis'] = dict(
    title="X Title",
)

overlaying = ["free", "y"]
side = ["left", "right"]
shift = [-50, 50]
#y axes
for i in range(2):
    fig.layout[f'yaxis{i+1}'] = dict(
        title=f"Y Axis Title {i+1}",
        overlaying=overlaying[i],
        side=side[i],
        shift=shift[i],
        # anchor="free",
    )

# Lines
y = [[1, 2, 3],
     [3, 1, 1]]
for i in range(2):
    fig.add_trace(go.Scatter(y=y[i],
                             name=f"line name {i+1}",
                             mode='lines',
                             yaxis=f"y{i+1}"))

# Title
fig.update_layout(title="Figure Title",
                  showlegend=False,)

# Show
fig.show()

@palben0 As long as you set margin_l=50, margin_r=50, there is no space to shift the ticklabels. I modified your code, changing margins, and setting autoshift=False, and anchor=β€œfree” (see below):

import plotly.graph_objects as go


# Figure
fig = go.Figure()   # width=800, height=400

# Layout
fig.layout.update(showlegend=False, xaxis_title="X Title",
                   margin=dict(l=150, r=50, t=80, b=60))



overlaying = ["free", "y"]
side = ["left", "right"]
shift = [-50, 50]
#y axes
for i in range(2):
    fig.layout[f'yaxis{i+1}'] = dict(
        title=f"Y Axis Title {i+1}",
        overlaying=overlaying[i],
        side=side[i],
        shift=shift[i],
        autoshift=False,
        anchor="free",
    )

# Lines
y = [[1, 2, 3],
     [3, 1, 1]]
for i in range(2):
    fig.add_trace(go.Scatter(y=y[i],
                             name=f"line name {i+1}",
                             mode='lines',
                             yaxis=f"y{i+1}"))

# Title
fig.update_layout(title="Figure Title",
                  showlegend=False,)

# Show
fig.show()

Your code still doesn’t shift the axes in any direction, but as you have set the anchor to β€˜free’, the y2 axis is also at the y1 axis location. (which is even worse.)

But it was shifted. You say it isn’t, because the plot background did not extend to the left. It cannot move because the anchor is free.

To understand how yaxis shift works, run:

help(go.layout.YAxis.shift).

This is how the result of my code looks on my computer:

And this is yours:

As you can see, on your version, the two axes are at x=0.