Skip to content

Feature Request: Allow hexbin to use a string for parameter C to refer to column in data (DataFrame) #18097

@tdpetrou

Description

@tdpetrou

Feature request

Currently the hexbin function allows for its first two parameters x and y to be strings of data (usually a pandas DataFrame), but not C

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
df = pd.DataFrame(np.random.rand(100000, 3))
df.columns = ['a', 'b', 'c']
plt.hexbin('a', 'b', C='c', data=df)

Results in IndexError: string index out of range

Currently, you must pass in C as a Series/array
plt.hexbin('a', 'b', C=df['c'], data=df)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy