Questions tagged [geom-point]
215 questions
1
vote
1 answer
Share a continuous value-color mapping across several ggplots
I want to make 4 side-by-side scatterplots in ggplot. In each plot, I am coloring the dots by a continuous variable. I would like to have the same values map to the same colors across the four plots so that I can compare the plots and use one common…

acn
- 65
- 1
- 5
1
vote
1 answer
where can I find the complete list of shapes and colors as character inputs for geom_point?
p <- ggplot(mtcars, aes(wt, mpg))
p + geom_point(shape = "square", color = "blue")
I have a function that will accept the shape and color parameters, which will be passed to geom_point. I need to check if the input is valid. So I need to do…

Bear Bile Farming is Torture
- 4,317
- 4
- 27
- 61
1
vote
1 answer
Legend mixing shapes with geom_points R
My legend is not showing correctly when I am doing my graph in R using ggplot2. One column of my dataset is represented by a geom_bar and the two others are represented by geom_points (one shape each). The circle and the diamond shape are showing…

Zoé Payre-Hance
- 13
- 4
1
vote
1 answer
Inconsistent behaviour of ggplot when adding points to sf maps
Using ggplot I want to add points to a sf map. Take this code:
ggplot(data = shapefile) +
geom_sf()+
geom_point(x = -70.67,y =-33.45, size = 10, colour = "red")
This code works fine for one of my shapefiles but not for another, and I'm not sure…

NBK
- 887
- 9
- 20
1
vote
2 answers
Scale_fill_manual not producing color fill specified by a condition
1: NO ISSUE
Suppose I download storm_econ_dmg.csv:
fileUrl <- "https://raw.githubusercontent.com/MichaelSodeke/DataSets/main/storm_health_dmg.csv"
download.file(fileUrl, destfile="storm_health_dmg.csv", method = "curl", mode="wb")
df1 <-…

Maestro
- 381
- 2
- 11
1
vote
2 answers
Highlighing individual data points with ggplot created from pipes
We have this simple data frame:
data <- data.frame(ID = rep(c("a","b"), each = 500),
time = 1:500,
val = rnorm(1000, mean=1, sd = 0.3))
We have data for 2 individuals (ID == a and b). We want to subset the data…

Ryan
- 1,048
- 7
- 14
0
votes
0 answers
Geom smooth format x-axis
I am working with time monitoring and I would like to use geom-smooth to have a trend curve.
I did the following code but the curve does not appear. I guess it's a format problem for the x-axis.
Do you know how to obtain a trend curve with geom…
0
votes
1 answer
Dodge geom_points based on only a single grouping variable when there are multiple grouping variables
I am having an issue with trying to dodge points only by the color aesthetic when I am also using another aesthetic for shape. When I add the option to dodge, it dodges the points such that each shape+color option is dodged. Is there a way to…

Jeff
- 3
- 1
0
votes
0 answers
Trying to label my points on a map in ggmap
image of my current plotDoing an analysis on Nuclear Explosions (after watching Oppenheimer), and I was able to plot a map using ggmap().
However, I want to add the 'Name' of the bomb as a label on the map, so that "Trinity" for example is visible.…
0
votes
1 answer
ggplot2: scale_color and scale_shape of different lengths
I'm trying to re-create this plot in R, but can't seem to get things to match. As I understand it, if I only want 1 legend (shapes and colors in one legend), then scale_shape_manual and scale_color_manual need to have the same values (or the same…

Nate
- 411
- 2
- 10
0
votes
1 answer
Coordinating colour and shape in legend and plot consistently using geom point and line
Trying to create graphs using ggplot2, and I am coming with a strange peoblem I can't seem to solve. I've looked at other answers on stack overflow but they don't seem to fix the problem. Between different samples, the colours and shapes used in the…

user22211903
- 1
- 1
0
votes
0 answers
ggplot2 - geom_point with pattern fill of shapes does not change even though I change the colors
I have been struggling since yesterday with this issue. I am trying to make the following geom_point figure with a black border for the points and two different colors, one per condition grey for the LF-EB and white for the HF-EB. However, even…

Carmen O
- 43
- 4
0
votes
0 answers
Dose-response curve, geom_point
I plotted the dose-response curve with the code below. However, the points on the graph don't seem to be correct. I would like to know how to plot the y-values corresponding to the x-values with the correct…

Hayoung Kwon
- 1
- 1
0
votes
0 answers
Ternary plot with ggplot - add legend and remove labels
This is only me second post so please forgive my ignorance! I've used ggplot to create a soil texture ternary plot with custom polygon fields and custom area because the USDA soil texture fields aren't compatible with UK soil surveying. I've…

James Rowson
- 11
- 3
0
votes
0 answers
How differentiate negative and positive numbers using scale_colour_manual and ifelse?
I get stucked in a code trying to plot a points that must be visualized in blue for positive and red for negative numbers, as follow:
ggplot(BCG, aes( reorder(x = SHARE, desc(SHARE)),
y = ATRATIVIDADE, color =…

Artur Neves de Assis
- 51
- 6