Skip to content

The size argument to px.scatter does not accept an integer #3070

@CarlAndersson

Description

@CarlAndersson

According to the documentation, it should be possible to give an integer to the size argument of px.scatter.
This does not seem to be the case, and it still tries to use it as a column name.
I would expect ot to just set all the markers to the same size. This is useful because sometimes the default value is a bit too small ot too large...

I'm not sure if this is the expected behavior or not, so this could either be a bug report or a feature request 😄

>>> import plotly.express as px
>>> df = px.data.iris()
>>> px.scatter(df, x='sepal_length', y='sepal_width', size=30)
ValueError: Value of 'size' is not the name of a column in 'data_frame'. Expected one of ['sepal_length', 'sepal_width', 'petal_length', 'petal_width', 'species', 'species_id'] but received: 30

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