Skip to content

size ignored in Scatter? #1589

Open
Open

Description

@guillaumew16

When using Object model, setting the keyword size to Scatter(...) does not modify the size of the points. Setting default_size works as expected. Using pyplot works as expected, weirdly. Version of bqplot is 0.12.36.

For example, this affects the provided example https://github.com/bqplot/bqplot/blob/master/examples/Marks/Object%20Model/Scatter.ipynb. Here is a MWE:

import numpy as np
import bqplot as bq
import bqplot.pyplot as plt

N = 50
a = np.random.rand(N)
x, y = np.random.randn(2, N)

# pyplot works as expected
fig = plt.figure()
plt.scatter(x, y, size=a)
fig

# Object model does not work as expected
xs = bq.LinearScale()
ys = bq.LinearScale()
xax = bq.Axis(scale=xs, label="X")
yax = bq.Axis(scale=ys, orientation="vertical", label="Y")
scat = bq.Scatter(x=x, y=y, scales={"x": xs, "y": ys}, size=a)
fig = bq.Figure(marks=[scat], axes=[xax, yax])
fig

I hope I did not miss something obvious... Thanks in advance!

Activity

  1. fcichos commented on May 28, 2023

    @fcichos

    Try with the parameter name default_size instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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