Skip to content

layout image is not rendered when two scatter traces have different zorders #4912

Open
@tunaflsh

Description

@tunaflsh

Steps to reproduce:

import plotly.graph_objects as go
fig = go.Figure()
fig.update_yaxes(scaleanchor='x')
fig.add_traces([{'type': 'scatter', 'mode': 'lines', 'x': [0, 1], 'y': [0, -1], 'zorder': 0},
                {'type': 'scatter', 'mode': 'markers', 'x': [0, 1], 'y': [0, -1], 'zorder': 1}])
fig.add_layout_image(dict(
    source="https://images.plot.ly/language-icons/api-home/python-logo.png",
    xref="x", yref="y", x=0, y=0, sizex=1, sizey=1, layer='below'))
fig.show()

Expected result; This doesn't happen when zorder is equal:

...
fig.add_traces([{'type': 'scatter', 'mode': 'lines', 'x': [0, 1], 'y': [0, -1], 'zorder': 1},
                {'type': 'scatter', 'mode': 'markers', 'x': [0, 1], 'y': [0, -1], 'zorder': 1}])
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3backlogbugsomething broken

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions