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

Horizontal Geom.bar not working #1266

Closed
xiaodaigh opened this issue Mar 27, 2019 · 6 comments
Closed

Horizontal Geom.bar not working #1266

xiaodaigh opened this issue Mar 27, 2019 · 6 comments

Comments

@xiaodaigh
Copy link

plot(x = ["a","b","c"], y= 1:3, Geom.bar(orientation = :horizontal))

this doesn't plot for me.

@Mattriks
Copy link
Member

Does this work?:

p = plot(x=["a","b","c"], y=1:3, Geom.bar(orientation = :horizontal),
    Scale.x_discrete )

@xiaodaigh
Copy link
Author

Yes. So that's a bug? Scale.x_discrete seems to be a good default in this case

@Mattriks
Copy link
Member

See these lines: For a typical barplot, if the orientation=:vertical then I would expect that the y-axis is numerical, and if orientation=:horizontal, I would expect that the x-axis is numerical. But your x-axis isn't numerical: why is that btw?

@xiaodaigh
Copy link
Author

It's a barplot so it's reasonable for xaxis to be categories, i.e. discrete

@Mattriks
Copy link
Member

I'm not sure that Gadfly works the way you think (for horizontal bars).
In this plot, the x-axis is numerical:

p = plot(y=["a","b","c"], x=1:3, Geom.bar(orientation = :horizontal) )

@xiaodaigh
Copy link
Author

ok this makes sense, so maybe need to update the doc. I might help with that

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

2 participants