ggplot2 Questions

1

Solved

I would like to justify (not just align!) multiline text in my ggplots, i.e. mostly title, subtitle, caption and annotations via geom_text() etc. Justified Text To be clear, by "justified text...
Intention asked 17/8, 2022 at 7:17

1

I created a ggplot2 bar plot and added a label, with the bar y-value, above the bar. d <- data.frame( Ano=2000+5*0:10, Populacao =c(6.1,6.5,6.9,7.3,7.7,8.0,8.3,8.6,8.9,9.1,9.3) ) d %>% g...
Kill asked 18/7, 2016 at 12:40

2

Solved

I'm trying to figure out how to annotate combined patchworks as if they were individual plots. I've got one patchwork consisting of three combined plots and another single plot. The final composite...
Millrun asked 31/8, 2022 at 22:7

2

Solved

I want to know whether it is possible to see the code of a plot that is stored in a variable. For example, given the following plot: library(ggplot2) myData <- data.frame(x=1:100, y = 100:1) m...
Caiman asked 28/5, 2015 at 22:51

2

Solved

With facet_zoom() from the ggforce package one can create nice zooms to highlight certain regions of a plot. Unfortunately, when zooming in on the y axis the original plot is always on the right si...
Windermere asked 5/10, 2018 at 12:26

3

Solved

I have a df with two curve definitions, each consists of two points and a curvature value. The goal is to plot two individual curves using ggplot2 geom_curve (or an alternative). I can generate my...
Fusiform asked 11/4, 2019 at 8:2

5

Solved

I have the following data Input Rtime Rcost Rsolutions Btime Bcost 1 12 proc. 1 36 614425 40 36 2 15 proc. 1 51 534037 50 51 3 18-proc 5 62 1843820 66 66 4 20-proc 4 68 1645581 104400 73 5 2...
Evolution asked 18/4, 2012 at 14:55

4

I have created a plot with ggplot2 where the x-axis labels are not readable unless the plot is larger than default. When viewing in Rstudio I am able to resize dynamically. When saving with ggsave(...
Abduce asked 22/9, 2016 at 8:57

5

Solved

Here is a link to my data. I use the following code: #read in data data = read.csv("ggplot_data.csv") #order by group then year data = arrange(data, group, year) #generage ggplot stacked area c...
Colonist asked 8/4, 2016 at 22:50

6

I am trying to use ggplot2 to create a performance chart with a log normal y scale. Unfortunately I'm not able to produce nice ticks as for the base plot function. Here my example: library(ggplot...
Pianoforte asked 10/1, 2013 at 10:18

5

Solved

I am working on finalizing a NMDS plot that I created in vegan and ggplot2 but cannot figure out how to add envfit species-loading vectors to the plot. When I try to it says "invalid graphics state...
Aubine asked 5/2, 2013 at 15:52

0

I'm trying to find a smart and stable way to place multiple subtitles on the same line, with one aligned to the left, the other one to the right. It should be a general solution as I'm The most con...
Nodababus asked 14/5 at 8:27

3

Solved

I would like to add horizontal lines to an existing plot, but I would only like to plot the line for certain intervals of the x-axis. For example, I would like to have a horizontal line at x=1:5 an...
Katakana asked 1/12, 2013 at 11:40

3

Solved

Please, find a data sample p below. I have produced the following ggsurvplot: I would like to remove the encircled "Strata"-text from the legend, that prints automatically. I think it is redunda...
Hawsepiece asked 3/1, 2020 at 7:54

6

Solved

I have a 3 column matrix; plots are made by points based on column 1 and column 2 values, but colored based on column 2 (6 different groups). I can successfully plot all points, however, the last p...
Castile asked 21/10, 2012 at 6:58

3

Solved

If you specify axis limits in ggplot the outlying points are removed. This is fine for points, but you might want to plot lines that intersect with the specified range, but ggplot's range or xlim/y...
Thrippence asked 5/9, 2014 at 11:45

5

Solved

Below is example code of a plot that does almost exactly what I want. The only thing I want to add is tick marks on the x axis (same size as the major ticks) according to the minor_breaks defined b...
Trotyl asked 23/1, 2013 at 21:51

24

Solved

I have used the following ggplot command: ggplot(survey, aes(x = age)) + stat_bin(aes(n = nrow(h3), y = ..count.. / n), binwidth = 10) + scale_y_continuous(formatter = "percent", breaks = c(0, 0....
Batter asked 13/8, 2010 at 0:5

19

Solved

I need to plot a bar chart showing counts and a line chart showing rate all in one chart, I can do both of them separately, but when I put them together, I scale of the first layer (i.e. the geom_b...
Tamberg asked 23/6, 2010 at 5:52

5

Solved

How to print angstrom square in x axis? I tried as follows. labs(x = "x axis" (Å^2)", y = "y axis")
Chevalier asked 15/6, 2016 at 3:24

3

I want to gradient fill a violin plot based on the density of points in the bins (blue for highest density and red for lowest). I have generated a plot using the following commands but failed to ...
Cotidal asked 11/12, 2016 at 14:20

2

I need to create a "thermometer"-looking graph using (hopefully) ggplot2, so that I can place it inside a Shiny app. Is it even possible to achieve something like this?! In reality, I onl...
Antemeridian asked 12/4 at 7:21

4

I am trying to create a plot that combines 2 separate legends and a grid of multiple plots. The issue I'm having is I'm finding it difficult to align the legends so they are visible and not overlap...
Guggenheim asked 7/2, 2023 at 16:24

4

Solved

I want to do the opposite of this question, and sort of the opposite of this question, though that's about legends, not the plot itself. The other SO questions seem to be asking about how to keep ...
Eisenstark asked 9/7, 2012 at 21:3

1

Solved

I am trying to use ggplot to plot a frequency plot where the dropped values still show in the legend. I have been able to achieve this by setting drop = FALSE in scale_fill_manual, however the drop...
Mammillary asked 10/4 at 15:53

© 2022 - 2024 — McMap. All rights reserved.