Category "ggplot2"

Plotting multiple wordcloud (ggwordcloud) with other types of plots in ggplot2

I am trying to plot several wordclouds in a scatterplot and I wonder if one can control the position of a wordcloud in ggplot? As an example the code below over

Is it possible to reorder only the facets of facet_wrap, without reordering the underlying factor levels?

Sample data frame: df <- data.frame(x=rep(1:10,4),y=rnorm(40),Case=rep(c("B","L","BC","R"),each=10)) I can plot each time series in its own facet with: g

How to use a variable to specify column name in ggplot

I have a ggplot command ggplot( rates.by.groups, aes(x=name, y=rate, colour=majr, group=majr) ) inside a function. But I would like to be able to use a param

Decrease the size of a graph in ggplot - R

I have two questions for this graph I did: The first, is how do I decrease the graph size?, I have tried with coord_fixed: ggplot(x, aes(fill=is_pass, y=pe

Is it possible to have one function to download various ggplot plots?

My shiny app generates a number of useful graphs. I would like to allow the user to download the graphs in various formats. I have done this before for a single

ggplot holes in stacked area chart

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, y

unable to set xlim and ylim using min() and max() in ggplot

I am missing something crucial here and can't see it. Why does min and max not work to set the axis limits? mtcars %>% select(mpg, cyl, disp, wt) %>

How to plot histogram with 2 variables

I have the following dataset date region Nr_individuals Povertydecile 01-01-2019 1 80 2 01-01-2019

Barplot of summed values per category in R - currently plotting highest value only

I have a data set (named data) as follows site year month supplier FG total 540853 2015 1 790122 T25 3 540853 2015 3 7901

Determining when there is a decrease in the rate of change

I have created plots of heart rate recovery against time, using ggplot2. I have noticed them seem to have an inflection point where the heart rate levels off. I

How do I limit the range of the viridis colour scale?

I have two sets of data, which I want to present using a heat map with the viridis color scale. For the first data set, my values range from 0 to 1.2 and I can

apply box plots to multiple variables

I have this dataframe: set.seed(50) data <- data.frame(age=c(rep("juv", 10), rep("ad", 10)), sex=c(rep("m", 10), rep("f", 10)),

Adding shading alternate areas for categorical variable in a bar plot in ggplot2

I am trying t o plot a bar plot using ggplot2as follows: library(ggplot2) ggplot(mtcars, aes(factor(carb))) + geom_bar() + coord_flip() x axis is a con

Fill white gaps in geom_area

I have a dataframe with daily datas for some factors ("fill" var) I would like to plot an area plot with the ggplot2::geom_area function but there could be miss

Set panel label size in R::multipanelfigure

I am creating a multi panel figure that includes a ComplexHeatmap object so I am using multi_panel_figure() instead of ggarrange(). I have tried to include an

R - Correlation heatmap created with ggplot2: How can I flip the labels on the y-axis?

I found this easy way to create a correlation heatmap using ggplot2: data(attitude) library(ggplot2) library(reshape2) ggplot(melt(cor(attitude)), aes(Var1,

How to add Latex code in ggplot2 legend labels?

Consider the following example: p <- ggplot(data = data.frame(A=c(1,2,3,4,5,6,7,8),B=c(4,1,2,1,3,2,4,1),C=c("A","B","A","B","A","B","A","B"))) p <- p + g

ggplot2: how to color a graph by multiple variables

I am fairly certain I have seen a solution for this somewhere, but as I have been unable to find it, here is my problem. I have some time series data identifi

plot this in ggplot. Controlling y axis line within a range

This is using base, where I can control the x and y axis range, where exactly the line should be drawn. plot(mtcars$mpg, mtcars$hp, ylim = c(0, 400), xlim = c(

R- How to set y-axis individually when using `facet_grid_sc()`

I want to plot the trend of the density (Density.est) of 3 species (Emar,Ecos and Sphyr) over time (2008,2009,2010) for two protection levels of a protected are