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...
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...
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...
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...
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...
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...
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...
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(...
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...
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...
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...
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...
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...
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...
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...
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...
24
Solved
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...
5
Solved
How to print angstrom square in x axis? I tried as follows.
labs(x = "x axis" (Å^2)", y = "y axis")
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 ...
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...
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...
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 ...
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...
© 2022 - 2024 — McMap. All rights reserved.