Questions tagged [geom-point]
215 questions
0
votes
1 answer
matching geom_point size to the geom_tile size
I'm trying to combine geom_tile with geom_point to show a gene expression knockdown effect on a cardiac phenotypes and whether this effect is enhanced or reduced compared to a control:
The following code creates and example of this.
g <- read_excel(…

krifa sallouha
- 1
- 2
0
votes
2 answers
ggplot2 removing NA for certain geoms
I am trying to create a combined plot that includes a geom_point of all points and a polygon surrounding groups of data using geom_encircle. However, I only want specific groups encircled. I have some example code below to help illustrate.
x <-…

Stavrum
- 51
- 1
- 7
0
votes
1 answer
ggplot: How can I add a second legend to a plot where factors all have different aesthetics and only 1 factor has a color gradient
I've coded this scatterplot but am hitting a wall and could use some help. I'd like it to include two legends:
one is intensity for only one of the factors (shown below), which I'm able to do
the other would include the shape for all factors and…

llamapants
- 55
- 4
0
votes
2 answers
print category multiple times in ggplot (no grouping)
I have a dataset like this, extracted from a large and complex data frame:
data_set <- data.frame("Name" = c("Mr X", "Mr Y", "Mr Z", "Mr X", "Mr Z"), "Score" = c(88, 93, 87, 89, 90))
I want to create a list plot, ordered by Score, but with each…

Hugues Mercier
- 31
- 2
0
votes
1 answer
Getting error "'to' must be a finite number" Plotting a function for adstock
Please see my Rcode below with data
channelName = as.character(myData$TV_total[1])
maxX = 1.05*max(myData$TV_total)
maxY = 1.05*max(myData$Total)
myPlotDataDF = data.frame(Return = myData$Total, Spend = myData$TV_total)
simpleScatterPlot <-…

Tushar B
- 35
- 8
0
votes
1 answer
Add second geom_layer on only one faceted plot with corresponding legend
I'm creating a faceted plot with a first data frame and I add a second geom_point to one of the panel. My problem is I would like to show the corresponding legend for the added point.
To plot the second geom_point on the panel I want, I created a…

Jude
- 153
- 2
- 8
0
votes
1 answer
Multicoloring Points in ggplot R
I have this code! Does anyone know how to make on legend to appear different colouring?
Using this code, on the plot it seems to appear different color points (*) but in the legend appears twice the same color red * for poth of my…

Maria Provelegiou
- 81
- 6
0
votes
1 answer
Ggplot, Last Geom_point colouring overwrites the first colouring
How can I make the colouring of points specific? As the code shows below which I used the last color overwrites the first colour and now on my legend I have data1 and data2 with the same colour, which is not what I…

Maria Provelegiou
- 81
- 6
0
votes
1 answer
Ggplot graph: colour points by geom_point and colour trendlines by group
I am attempting to colour the raw data points, but I can't seem to find the information on how to do that, when I am already defining colours by group.
Data:
data = read.csv('TotMaxSize.csv')
structure(list(Column1 = 1:6, yrblock15 = c(2004L, 2004L,…

Leanne Greenwild
- 63
- 6
0
votes
1 answer
Cannot plot correctly with geom_flags
I am trying to plot some data (mainly character data, unfortunately) and I wanted to use geom_flag to create little flag images to put under the labels on the x axis (x = Country) to make it more clear since I cannot write the full country name (it…

Cecilia Bonucchi
- 7
- 5
0
votes
2 answers
How to change size and fill color of a circular shape dynamically in R ggplot?
I have a sample dataframe in R.
df <- data.frame(product_id= c("A","A","A","B","B","B","C","C"), year = c("2019", "2020", "2021", "2019", "2020", "2021", "2019", "2020"), profit=c(1.5, 2.2, 2.3, 1.4, 1, 16, 1.9, 25), sale = c(1.2, 1.8, 1.9, 2.0,…

solo
- 71
- 7
0
votes
1 answer
How to correctly add average, standard deviation and jitter in geom_plot()? ggplot2
I am trying to create a graph that shows the mean, standard deviation and the dots of each value (jitter). However, I was unable to insert the average point and the standard deviations are the same for all categories (and this is incorrect).
My code…

Anderson N. Barbosa
- 132
- 8
0
votes
1 answer
Missing values in geom_point()
So I have a plot which has taken me ages to produce. It needs to specify month and be both a line and point like this:
However I get this error message and 'September' doesn't appear as a point.
Warning messages: 1: Removed 1 rows containing…

Steph Curtis
- 47
- 2
0
votes
1 answer
Mapping points using ggmap
Data is
> head(latlon1.df)
lat lon
1 35.86417 -95.65556
2 29.72333 -98.69444
3 29.52917 -97.46417
4 40.82806 -72.86556
5 26.73500 -81.05111
6 NA NA
ggmap(usa) +
geom_point(data = latlon1.df, mapping = aes(x =…
0
votes
1 answer
Grouping and colouring with ggplot at the same time
I've got two teams and a given value for each team and year for a certain time interval. My data looks like the following:
yearID
teamID
value
2020
0
5
2020
1
7
2019
0
3
2019
1
1
I want to plot this with a point for each year and…

fabi
- 454
- 1
- 5
- 12