altair_pandas
altair_pandas copied to clipboard
ENH: scatter plot support for colormap
See: pandas.DataFrame.plot.scatter
df = pd.DataFrame(np.random.rand(50, 4), columns=['a', 'b', 'c', 'd'])
df.plot.scatter(x='a', y='b', c='c', colormap='viridis')

If this looks good, I'll update tests.
Looks good. One concern I have is that the names of matplotlib colormaps do not correspond to the names of vega schemes, but there's not really any easy way around that.
can we for all those params support both strings and alt objects?
can we for all those params support both strings and alt objects?
I'd lean toward no. I think the main benefit of this API is the ability to create charts that basically work on multiple backends. If we start supporting altair-specific extensions of the core API, then that flexibility goes away, and it may not be apparent to users when they have created a chart that will no longer render with one of the other backends.
@jakevdp how would you like to proceed on this?
Let's go ahead and apply colormap directly to scheme as here. Not a perfect solution, but I think it's the best thing that can be done easily at this point.
First tests and a couple minor changes.