Skip to content

ENH/VIS: Pass DataFrame column to size argument in df.scatter #8244

Closed
@TomAugspurger

Description

@TomAugspurger

You can already kind of do this by passing in the numpy array

In [83]: df = pd.DataFrame(np.random.randn(100, 2))

In [84]: df['z'] = np.random.uniform(size=(100))

In [85]: df.plot(kind='scatter', x=0, y=1, s=df.z.values * 1000)
Out[85]: <matplotlib.axes._subplots.AxesSubplot at 0x11a81df60>

p

But when I merge #7780 (coloring by column) it would be natural (and awesome) to do df.plot(kind='scatter', x='x', y='y', c='color', s='size')

Shouldn't be too hard if we're willing.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions