Closed
Description
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)