Comments (5)
Maybe the accepted answer on this SO question is an option to implement the "removing geoms" functionality. It really removes geoms from the grid object instead of changing their attributes to hide them.
https://stackoverflow.com/questions/13407236/remove-a-layer-from-a-ggplot2-chart
Here is how it looks on the reprex from above: It solves the problem.
# Function definition from SO:
remove_geom <- function(ggplot2_object, geom_type) {
# Delete layers that match the requested type.
layers <- lapply(ggplot2_object$layers, function(x) {
if (class(x$geom)[1] == geom_type) {
NULL
} else {
x
}
})
# Delete the unwanted layers.
layers <- layers[!sapply(layers, is.null)]
ggplot2_object$layers <- layers
ggplot2_object
}
p <- ggstatsplot::ggbetweenstats(outlier_data, group, response)
remove_geom(p, "GeomViolin")
from ggstatsplot.
It's the same issue as #895
You just need to pass: violin.args = list(width = 0, linewidth = 0)
to solve the problem.
from ggstatsplot.
I tested the linewidth = 0
addition, but for me, it does not fix the problem at all:
ggstatsplot::ggbetweenstats(outlier_data, group, response,
violin.args = list(width = 0, linewidth = 0))
If you make it blue, you can clearly see that the line belongs to the violin plot.
ggstatsplot::ggbetweenstats(outlier_data, group, response,
violin.args = list(width = 0,
linewidth = 0,
color = "blue"))
from ggstatsplot.
I've already documented this in #900. Just waiting to merge it.
from ggstatsplot.
Thanks, I have looked at it. I can only see that you documented the linewidth = 0
argument in your commit with the message "correct way to remove violin plot".
Please read my comment above where I say that this linewidth = 0
argument does not work for me.
Do you have any idea why? Can you reproduce this behaviour?
from ggstatsplot.
Related Issues (20)
- ggpiestats Cramer's V upper confidence intervals is always 1, and it shouldn't be HOT 2
- packages not installing in Rstudio HOT 1
- Invalid class "ddenseModelMatrix" object HOT 1
- Error in `filter()`: ! In argument: `!is.na(x)`. Caused by error: HOT 1
- is there a way to modify the whisker portion of `ggbetweenstats`? HOT 1
- Change in palette HOT 1
- Automatic color change to violin and box plot (from black -> orange) HOT 1
- How to export data from grouped extract_stats efficiently?
- Second Confidence Interval Always 1.00 For K-W? HOT 5
- Option for Pairwise Effect Sizes in Caption HOT 1
- ggbetweenstats Hedge's g change it to Cohen's d HOT 1
- Update outdated docs
- Add details to `ggdotplotstats()` regading the statistic of interest
- Decimals won't work HOT 12
- Issue: manually chosen colors do not work for ggbetweenstats HOT 1
- Highlight some points in violin plots HOT 1
- Minor refactoring of `ggbarstats()`
- Don't drop empty groups HOT 1
- Question: are numerical results available in the plot object? HOT 6
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 ggstatsplot.