-
Notifications
You must be signed in to change notification settings - Fork 572
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Select data from external data frame for aesthetics? #262
Comments
To break it down, there are two issues hidden in this. Being unable to accomplish the same objective by either ggplot(iris, aes(x='Sepal.Length', y='Sepal.Width', color=[5]*len(iris))) + geom_point() or ggplot(iris, aes(x='Sepal.Length', y='Sepal.Width')) + geom_point(aes(color=[5]*len(iris))) There is some re-factoring going on -- the conclusion of which should have this both sides of this issue resolved or more straight forward to fix. |
So, the two issues are that:
is #252 the refactoring you're talking about? |
Yes for 1, as long as aesthetics do accept a list or more generally an array-type then your situation should work. The 2nd on has to do with the current state, in that all #252 is done and the continuation is #266. However, I think it should end up being covered by the refactoring done by @JanSchulz. Somewhere in the comments at #221 is some structure of the refactorings although this issue isn't mentioned explicitly. |
The "accept a list of values" should be easy: that's another if-case in |
this will probably be handled in #285 |
fun example: : from pandas import rpy
from ggplot import *
iris = rpy.load_data('iris')
iris_types_df = iris.groupby('Species').mean()
ggplot(iris, aes(x='Sepal.Length', y='Sepal.Width',
colour=iris_types_df.ix[iris.Species,'Petal.Length'])) + geom_point() I that case This is the case from @has2k1, where one specifies a series as a mapping ( |
Here is some R code, to explain what I want to do:
Which results in:
Is there a way to do the above with python ggplot? I tried doing the same, but it gives an error:
Obviously, this is a pretty useless example, and I could have just put the means in the original data frame. But some of the data I'm plotting is really big, so putting a handful of cluster means into the original data frame leads to massive data redundancy, requiring lots of extra memory.
The text was updated successfully, but these errors were encountered: