Questions tagged [ggplot2]

ggplot2 is an actively maintained open-source chart-drawing package for R, written by Hadley Wickham, based upon the principles of "Grammar of Graphics". It partially replaces R's basic plot and the lattice package, while providing a clean, powerful, orthogonal and fun API.

Filter by
Sorted by
Tagged with
0
votes
0answers
7 views

Determining outliers by group in R

I suspect that Donor 1 in my dataframe below might be an outlier as compared with the other seven donors. I am wondering if I should eliminate ALL concentration measurements from Donor 1. I was able ...
0
votes
1answer
12 views

Change x-axis ticks

Good afternoon everyone, I am having difficulties plotting a time series with ggplot. I have a time series with daily data from 2020-01-30 to 2020-10-22. When I plot the data with the following code, ...
0
votes
0answers
3 views

Adding convex hull to ggplot scatterplot

How can I add a convext hull to my ggplot scatterplot that connects dots based on the "region" parameter. p1 <- ggplot(SP3, aes(x = Population_Density, y = 100000_population, color = ...
2
votes
1answer
9 views

align y axis labels inward when y axis position is set “right”

In R {ggplot2} I want to align the most outer axis labels inward, which is no problem for x and y axis labels when the position argument is not specified (see first plot below). However, when the y ...
-1
votes
0answers
27 views

How to combine bar plots on same wrap

I need to show Memory and CPU usage for every Numa node on same wraps, so architecture was visible. Something like this: This is code I have: library(tidyr) library(ggplot2) numa.nodes <- tibble (...
0
votes
0answers
21 views

Function that outputs a wordcloud in R?

I have a df with several tweets. I want create a function that filters the tweets by a specific word I put on the function, and then, after clean the text data I want the output to be a wordcloud with ...
0
votes
0answers
8 views

Adding an optional selection button to show an additional variable with geom_polygon and ggplotly (interactive map)

I'm working on an interactive map with ggplot, geom_polygon and ggplotly and create the following map with this code: plot2 <- ggplot(maprel1, aes(x = x, y = y, group = group, text =...
0
votes
0answers
22 views

How can I put the red color in Korea and black in other countries? [duplicate]

I want to put the color red only in Korea and black in other countries. Could you help me out? ggplot(subset(juho, Country != 'Korea'), aes(x = YEAR, y = Mean)) + geom_line(aes(color = Country, ...
0
votes
1answer
17 views

R ggplots with anti-aliasing and wmf format on windows

I'm trying to export a ggplot to word as an windows metafile on windows platform. Some suggest cairo to remove aliasing, but I need to save the plot as windows metafile, which don't work with wmf. ...
1
vote
1answer
29 views

R: Creating advanced bar plot with three categorical variables + summarizing table attached at the bottom of figure

This is my very first question on stackoverflow. I have a question about creating a bar plot with three categorical variables using R. I am only using R for three weeks, so I hoped you could help me ...
0
votes
0answers
28 views

How to add total count labels to ggplot bar graph [duplicate]

I am trying to add total count (n) to each bar on my ggplot bar graph. Can anyone help? Thanks. mydf_tmp <- mydf %>% group_by() %>% summarise(Giant.Remora = sum(Giant.Remora), ...
0
votes
1answer
14 views

How to add points on SpatialLinesDataFrame using ggplot2?

I have a spatial lines data frame and some points on it. The points have 3rd column some numbers let's say average roadkills (animal killed by cars, aka hit-run) at x and y coordinates. I want to plot ...
0
votes
0answers
17 views

ggplot color question regarding one country be red or other be black [duplicate]

g <- ggplot(data=juho, aes(x=YEAR, y=Mean, color = Country)) g <- g + geom_line(aes(x=YEAR, y=Mean, color = Country), lwd = 1) + theme_bw() + scale_x_continuous(breaks = c(2000,2003,2006,...
1
vote
1answer
13 views

Multiple QQ Plots on Data Set with Unknown number and name of variables

I want to produce qqplots & lines on chem data that comes to me as an excel file with an unknown number of variables and an unknown number of observations then store each plot as a data object eg ...
0
votes
1answer
27 views

How can I group my bars in ggplot2 by fill color, while maintaining descending order?

I am currently working on a barplot where I have data collected from timeA and timeB. I took a measurement (ex: mass) of different objects. The objects measured are not consistent in the timeA group ...

15 30 50 per page
1
2 3 4 5
2499