Skip to content
This repository has been archived by the owner on Jun 5, 2020. It is now read-only.

Line color ('c' kwarg) #17

Open
cbenz opened this issue Feb 5, 2018 · 1 comment
Open

Line color ('c' kwarg) #17

cbenz opened this issue Feb 5, 2018 · 1 comment

Comments

@cbenz
Copy link

cbenz commented Feb 5, 2018

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?

@jakevdp
Copy link
Member

jakevdp commented Feb 5, 2018

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)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants