Skip to content
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

geom_text() draws lines #595

Open
southsinger opened this issue Feb 19, 2017 · 4 comments
Open

geom_text() draws lines #595

southsinger opened this issue Feb 19, 2017 · 4 comments

Comments

@southsinger
Copy link

southsinger commented Feb 19, 2017

I'm using Jupyter notebook, python 3 with conda in back.

points = pd.DataFrame(columns=["x", "y", "id"])
for x_it in range(1, 5):
    for y_it in range(1, 5):
        l = ijl(x_it, y_it)
        new_row = {"x": x_it / 5, "y": y_it / 5, "id": l}
        points.loc[l] = new_row
points.id = points.id.astype("int")
plot = ggplot(aes(x='x', y='y', label="id"), data=points) + geom_point() + geom_text()
display(plot)

This chunk of code, for some unknown reason, connects points with lines
example

@armintabari
Copy link

I have the same problem:
chart = ggplot(df, aes(x='x-tsne', y='y-tsne', color='label') ) \ + geom_point(size=70,alpha=1) \ + geom_text(aes(label='em'), size=9 , angle = 45,hjust=0, vjust=0) \ + ggtitle("tSNE emotion words colored by main emotion") \ + scale_color_brewer(type = 'qual', palette =1)
screen shot 2017-05-16 at 3 22 09 pm

@qlik-matt
Copy link

I'm seeing the same result
screen shot 2018-03-02 at 2 27 56 pm

@xmarvin
Copy link

xmarvin commented Mar 13, 2018

I have the same issue. Looks like it's a bug in geom_text()
I've found a way to fix it.
df['index'] = df['index'].astype(str) should fix this issue.
Expected type for column is string.

@yfarjoun
Copy link

happens also in Jupyter with python2.7

@ghost ghost mentioned this issue Jul 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants