Skip to content
This repository was archived by the owner on Jun 3, 2024. It is now read-only.
This repository was archived by the owner on Jun 3, 2024. It is now read-only.

Can't set marker opacity if also setting marker symbol #203

Closed
@slishak

Description

@slishak

In the following example, the marker opacity is always 1 if I set a marker symbol. For the second trace, I haven't set a marker so the marker opacity is respected. The legend is drawn with the correct opacity. If I use plotly.offline.plot to plot the figure outside Dash it looks ok.

import dash
import dash_core_components as dcc
import dash_html_components as html
import random

app = dash.Dash()

n_points = 50

x = list(range(n_points))
data = [
    {
        'x': x,
        'y': [random.random() for _ in range(n_points)],
        'marker': {'symbol': 'x', 'opacity': 0.05, 'size': 20},
        'mode': 'markers',
        'type': 'scattergl',
    },
    {
        'x': x,
        'y': [random.random() for _ in range(n_points)],
        'marker': {'opacity': 0.05, 'size': 20},
        'mode': 'markers',
        'type': 'scattergl',
    },
]
fig = {'data': data, 'layout': {}}

app.layout = html.Div(children=[
    dcc.Graph(
        id='example-graph',
        figure=fig,
    )
])


if __name__ == '__main__':
    app.run_server(debug=True)

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions