Category "ggplot2"

Plotly not displaying the labs caption from ggplot

I have this code for making a ggplot, which works fine (MRE with a built-in dataset): mydata <- airquality avg <- mean(mydata$Wind) stde <- sd(mydata$W

geom_segment not recognising factored x-axis

Aim: produce a bar plot representing a time series of measurements (variables) taken at 14 Sites (factors), including drawing horizontal lines to demonstrate be

what are these gray lines inside the bars of my ggplot bargraph?

I wanted to create a graph to show which continent has the highest co2 emissions total per capita over the years, so I coded this: barchart <- ggplot(data =

How to delete label above bar chart in R that's already in the legend?

this is my first post! Just wondering how to remove these titles above the charts: Here's the code for the diagram! I imagine I'll have to use something like:

fancy pie chart in R using ggplot2

I have a pie chart below, and I would like to leave extra white space between each pie and paste the value of each letter in each pie (A=25). how to get around

R: How to remove spikes/outliers on ggplot2

Given the following R script: library(glue) library(ggplot2) library(tidyverse) library(magrittr) library(stringi) library(dplyr) ir.data <- read.csv(file="

ggplot line legend disappears with alpha < 1

When trying to plot some data in ggplot2 using geom_line(), I noticed that the legend items become empty if I use alpha < 1. How can I fix this and why is th

Melt a frequency table in order to use ggplot2

I have a "frequency table" similar to this one # Create a matrix df<- matrix(sample(0:10,35,replace=T),nrow=5, ncol=7) # Rename columns and rows colnames

How can I reorder facet wrap by the values of the first column?

The following code is from Stefan, who answered a related question library(ggplot2) library(dplyr) library(tidyr) library(tidytext) mtcars2 <- as_tibble(mtc

R: Labels not displaying at a ggplot2 graph

Given this R script: library(glue) library(ggplot2) ir.data <- read.csv(file="~/apps/mine/cajueiro_weather_station/sensor_data/temperature_data.csv", header

ggplot facet different Y axis order based on value

I have a faceted plot wherein I'd like to have the Y-axis labels and the associated values appear in descending order of values (and thereby changing the order

Drawing a visualization of system capacity (pipe flow?)

I need to reliably and repeatably visualize a system which is like pipes that can pass a certain amount of fluid per unit of time. The real system is a therapy

r - Plotting monthly time series data in R - cannot plot more than 10 series

I'm having a lot of trouble plotting my time series data in R Studio. My data is laid out as follows: tsf Time Series: Start = 1995 End = 2021 Frequency = 1

How can I italicize part of a ggplot2 plot title when knitting the figure in an RMarkdown file?

If I'm just working in R to save a plot as a PNG I'm able to use the {ggtext} package to incorporate basic markdown into elements of my plots, but {ggtext} outp

Reverse order of bar chart colours while keeping legend order and colours

I am working on ggplot2 in R, and have used automatic colouring for the plot. It plots stacked bar charts and then converts them to the pie chart. Here is the c

How do i replicate these plots using ggplot?

plots This is what I have tried so far. The box plot is kind of close, but the other plot is way off. ggplot(data_anova, aes(x = delay, y = soa, color = age)) +

Custom interaction Plotly in ggplot - R

I have a massive dataset that makes graph plotting tedious and complex. Assume this simplified dataset: library(data.table) library(plotly) library(ggplot2) lib

grouped (twice) and stacked bar chart with facet wrapping

Here is my sample data mydata = data.frame (student =c("A","A","A","A","A","A","A","A","A", "A","A","A","A","A","A","A","B","B","B","B","B","B","B","B","B","B",

Annotate ggplot2 across multiple facets

I have recently started using the facet_nested function from the ggh4x package and I really like the look of the nested axis. I would like to annotate the plot

trouble with labeling axis with strings using ggplot (R)

I'm a college student and we have to create some graphs using Rstudio for an assignment. I've managed to do the core objective for this first task, which is to