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...
Bulldog asked 1/4, 2023 at 15:31

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...
Leanaleanard asked 28/6, 2022 at 9:47

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...
Furness asked 30/1, 2022 at 16:6

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 ...
Marek asked 9/1, 2022 at 0:9

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...
Irtysh asked 29/12, 2021 at 18:49

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...
Passage asked 2/7, 2020 at 16:42

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...
Amendatory asked 25/1, 2021 at 11:23

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 ...
Consummate asked 5/3, 2018 at 12:48

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...
Aboard asked 15/5, 2014 at 17:59

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...
Lingulate asked 23/8, 2020 at 18:25

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 ...
Ceramic asked 28/5, 2020 at 22:28

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...
Haney asked 8/4, 2018 at 13:35

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...
Opossum asked 13/8, 2019 at 10:31

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...
Preciousprecipice asked 23/4, 2019 at 12:59

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...
Imbecilic asked 27/9, 2018 at 14:24

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...
Frisby asked 5/12, 2010 at 2:28

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...
Recept asked 7/3, 2018 at 21:2

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...
Edgaredgard asked 18/10, 2016 at 7:55

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(...
Gaivn asked 19/12, 2017 at 1:24

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...
Dairyman asked 5/12, 2017 at 10:54

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...
Chaisson asked 13/7, 2017 at 9:4

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). ...
Hopeh asked 16/6, 2017 at 18:37

© 2022 - 2024 — McMap. All rights reserved.