yhat / ggpy

ggplot port for python
http://yhat.github.io/ggpy/
BSD 2-Clause "Simplified" License
3.7k stars 571 forks source link

geom_point: shape and color sourced on the same column generates two legends instead of one. #89

Open eduardflorinescu opened 11 years ago

eduardflorinescu commented 11 years ago

Shape and color sourced on the same column generates two legends instead of one which is not consistent with ggplot2.

Steps to reproduce:

from ggplot import *
print ggplot(aes(x="wt", y="mpg", color = "factor(cyl)", shape = "factor(cyl)"), data=mtcars) + \
geom_point()
plt.show(1)

Actual outcome The resulted chart unnecessary have two legends instead of a fused one like the one in the second image image

Expected outcome The legend should be only one and have the colored shapes instead: image

Legend should be similar to the exemple given in the R ggplot2 documentation http://docs.ggplot2.org/0.9.3.1/geom_point.html

image

glamp commented 11 years ago

Thanks for finding this! I'm sure we'll eventually get to this one but it will most likely be a little while--still working on color scaling issues w/ facets and legends getting cut off in in IPython

eduardflorinescu commented 11 years ago

Personally I don't need this bug fixed, but I found it out and thought to put it here. Thanks to everyone that is working on this project.

eduardflorinescu commented 10 years ago

This is how everything looks with the latest code: The issue still reproduces figure_1

has2k1 commented 10 years ago

The solution to this issue should be implemented after #283 and #221.