ggproto Questions
5
Solved
I'd like to create a split violin density plot using ggplot, like the fourth example on this page of the seaborn documentation.
Here is some data:
set.seed(20160229)
my_data = data.frame(
y=c...
Mellisamellisent asked 1/3, 2016 at 7:49
2
These objects print the same but the objects themselves are different.
library(ggplot2)
p1 <- ggplot(cars, aes(speed, dist)) + xlim(1, 2) + geom_point() + geom_line()
p2 <- ggplot(cars, aes(s...
Fere asked 7/4, 2023 at 17:38
1
Solved
This is essentially a follow up question on How does ggplot calculate its default breaks? and I came across this when trying to find a slightly more elegant solution for How to add y-axis labels in...
1
Solved
This question came up on answering How to show arrows in backward and forward directions in a ggplot2 legend?
I thought that a good way to automatically define the direction of the arrow in the gly...
1
Solved
I've built this new ggplot2 geom layer I'm calling geom_triangles (see https://github.com/ctesta01/ggtriangles/) that plots isosceles triangles given aesthetics including x, y, z where z is the hei...
1
Solved
When I modify parts of a duplicated Geom object, this also modifies the underlying original Geom. Why?
(Big big thanks to user Stefan to identify this problem via comment on a now deleted previous ...
1
Solved
As a follow up to this famous thread. I decided to ask a new question because this is more specifically for vertical legends, and the given answers still don't provide a fully satisfactory so...
2
Solved
This is a question related to a custom geom which is modified from this answer. The given geom failed with grouping, so I included coord_munch in draw_panel, much inspired by both GeomLine and Geom...
4
Solved
When plotting a bar chart, I often add labels to bars to signify the y-value for each bar. However, I run into trouble when the bar becomes too low, making the label unreadable or simply ugly.
Exam...
4
Solved
I have a faceted plot with very diverse data. So some facets have only 1 x value, but some others have 13 x values. I know there is the parameter space='free' which adjusts the width of each facet ...
7
Solved
I would like to draw a hollow histogram that has no vertical bars drawn inside of it, but just an outline. I couldn't find any way to do it with geom_histogram. The geom_step+stat_bin combination s...
3
Solved
coord_cartesian doesn't allow one to set per-facet coordinates, and using other range-limiting tends to produce a straight-line on the specific extreme. Since we have widelay-varying y-ranges, we c...
1
Solved
I'm trying to build a custom stat function with ggplot2 wherein I would like to access a discrete variable to compute a statistic with per group. However, the default behaviour of ggplot layers is ...
2
I am trying to create a facet_multi_col() function, similar to the facet_col() function in ggforce - that allows for a facet layout with a space argument (which is not available in facet_wrap()) - ...
Broadcloth asked 2/11, 2019 at 2:51
1
Solved
I wanted to see where factor values are turned into numeric ones. I tried to achieve this by simply adding print statements everywhere...
geom_tile2 <- function(mapping = NULL, data = NULL,
st...
1
Solved
I'm trying to write a custom stat_* for ggplot2, where I would like to color a 2D loess surface using tiles. When I start from the extension guide, I can write a stat_chull like they do:
stat_chul...
1
Solved
I am trying to create a new geometry for ggplot as described here, while adapting it to deal with Simple Features objects.
As an example, let's take the same exercise of plotting the convex hull o...
1
I just started working with R not long ago, and I am currently trying to strengthen my visualization skills. What I want to do is to create boxplots with mean diamonds as a layer on top (see pictur...
8
Solved
Say have a linear model LM that I want a qq plot of the residuals. Normally I would use the R base graphics:
qqnorm(residuals(LM), ylab="Residuals")
qqline(residuals(LM))
I can figure out how to...
2
Solved
I have the following dataset:
df <- data.frame(dens = rnorm(5000),
split = as.factor(sample(1:2, 5000, replace = T)),
method = as.factor(sample(c("A","B"), 5000, replace = T)),
counts = samp...
3
This question is related to
Create custom geom to compute summary statistics and display them *outside* the plotting region
(NOTE: All functions have been simplified; no error checks for correct o...
2
Solved
Is there a way to get the arrowhead closed on geom_curve? The same code works with geom_segment. Maybe its a bug?
library(tidyverse)
set.seed(123)
data <- data_frame(x = rnorm(10), y = rnorm(...
1
Solved
In order to plot half densities, I am using the function described in this post: Split violin plot with ggplot2
However, when I want to draw the quantiles on the densities, like on a normal geom_v...
1
Solved
What I want to do
I currently have a custom theme for my plots, and I want to have on top of that some predefined parameters for all type of plots. My first focus is on bar charts, where I want to...
1
Solved
The reproducible data below contains 50 observations for each animal (cat and dog) for each season (Summer and Winter) for two covariates (cov1 and cov2) and their respective error estimates (SE). ...
1 Next >
© 2022 - 2024 — McMap. All rights reserved.