pdvega icon indicating copy to clipboard operation
pdvega copied to clipboard

Line color ('c' kwarg)

Open cbenz opened this issue 7 years ago • 1 comments

Hi! Thanks for this very cool library!

My goal is to plot a DataFrame which represents a time series.

I'd like to use these encoding channels in my plot:

  • x channel is the period column,
  • y channel is the value column,
  • color channel is the series_code column.

I'm wondering if the line plot isn't missing a c= keyword, like the scatter plot.

What do you think about it?

cbenz avatar Feb 05 '18 12:02 cbenz

That's tricky, because pdvega aims to follow the Pandas plotting API, which doesn't support that.

The way to do that in the current API is something like this:

data.pivot_table(index='period', columns='series_code', values='value').vgplot.line()

(There may be some typos there, but you get the idea)

jakevdp avatar Feb 05 '18 16:02 jakevdp