Skip to content

geom_point cannot be plot when the input for the parameter 'shape' is a string #317

@alshan

Description

Preconditions
Plot the following:

extra_points = pd.DataFrame({'a': [0, 0], 'b': [1, 4]})
plot = ggplot() + geom_point(data=extra_points, mapping=aes(x='a', y='b'), shape='X')

The following would be shown:
image

In R, you would have the following

library(ggplot2) 

extra_points <- data.frame(x = c(3.0, 4.0, 5.0), y= c(3.0, 4.0, 5.0))

# create factors with value labels 
mtcars$gear <- factor(mtcars$gear) 
mtcars$am <- factor(mtcars$am) 
mtcars$cyl <- factor(mtcars$cyl) 

ggplot() + 
geom_point(data = mtcars, aes(x = wt, y = drat, color = gear, shape = am)) + geom_point(data = extra_points, aes(x, y), shape = 'X', size = 10)

image

You can find more about this here:

http://sape.inf.usi.ch/quick-reference/ggplot2/shape

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions