Comments (6)
We discussed it with @friep and @sowla and concluded the ordering of labels is right, because the bottom left corner is the origin.
from ggstance.
This looks to be the same as in ggplot2 so this would have to be fixed upstream first. Can you file there please?
from ggstance.
I think the problem is unique to ggstance.
In the original (vertical) plot, the colors go from left to right, and correspond to the legend order from top to bottom. This is expected. With ggstance, left becomes bottom and right becomes top, and the colors go from bottom to top while the legend remains unchanged. Also, the labels on the y-axis are in reverse alphabetical order, it seems more natural to have the alphabetical order running from top to bottom in this kind of plot.
Perhaps we just need geom_boxplothr()
and friends (for r = reverse)? Or stat_rev()
?
library(tidyverse)
mpg %>%
ggplot(aes(x = class, y = cty, fill = drv)) +
geom_boxplot()
Created on 2018-07-21 by the reprex package (v0.2.0).
from ggstance.
The original issue can be solved with reverse = TRUE
, maybe this should be the default (or inverted internally)?
library(tidyverse)
library(ggstance)
#>
#> Attaching package: 'ggstance'
#> The following objects are masked from 'package:ggplot2':
#>
#> geom_errorbarh, GeomErrorbarh
mpg %>%
ggplot(aes(x = cty, y = class, fill = drv)) +
geom_boxploth(position = position_dodge2v(padding = 0, reverse = TRUE))
Created on 2018-11-08 by the reprex package (v0.2.1.9000)
from ggstance.
(At least half of it -- it's easy enough to reverse the order of the vertical axis manually, but I still feel top-down is the most intuitive order, and ggstance could make it easier for the user to achieve it.)
from ggstance.
Thanks! So little code, so much bugfix!
The labels on the vertical axis are still reversed, though. This seems difficult to fix.
library(tidyverse)
library(ggstance)
mpg %>%
ggplot(aes(x = cty, y = class, fill = drv)) +
geom_boxploth()
Created on 2019-07-09 by the reprex package (v0.3.0)
from ggstance.
Related Issues (20)
- x y axis issue HOT 6
- Modify bars in `geom_pointrangeh` HOT 1
- Would it be possible to add an hjust argument to position_stackv to automate text label positioning in stacked horiztonal bar plots? HOT 1
- Broken 'geom_barh' or stupid user? HOT 1
- Tests fail in dev ggplot2
- Should stat_counth() be exported? HOT 1
- differences between Geomerrorbarh in ggplot2 and ggstance HOT 2
- document aesthetics?
- ggstance error with height argument (All height aesthetics in ggplot no longer work if ggstance is loaded) HOT 1
- geom_violinh fails with warning to "Please use `to_lower_ascii()`" with newly-released ggplot2 HOT 3
- Update vdiffr test cases for new ggplot2 release
- Warning: Ignoring unknown parameters: height
- The coord_flip() function not well in geom_signif, is it possible to use ggstance to solve?
- functionality missing from ggplot2? HOT 5
- Is this possible to achieve this with the ggplot2 3.3.0?
- Is it possible to achieve a histogram with a horizontal boxplot in the ggplot2 3.3.0? HOT 1
- question, not issue HOT 1
- Revdepcheck failure with upcoming ggplot2 version HOT 1
- 'scales' dependency is absent from DESCRIPTION
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ggstance.