Questions tagged [geom-point]
215 questions
1
vote
1 answer
Filled colour and white border geom_points in ggplot2?
How to change the points such that it is filled with color on the inside (according to the factor) but has a white border on the outside? I can't find an example with the standard pch chart
library(data.table)
A = data.table(x = 1:4, y = 1:4, z =…

Rspacer
- 2,369
- 1
- 14
- 40
1
vote
1 answer
geom_point - change colour of variable
I coloured my data by "Full Bath", however it is a similar shade & unclear.
I am trying to change the colour by variable of "Full Bath" to be more clear.
Could anyone help :)
This is what I have:
data %>%
ggplot(aes(Sale.Price, Total.Bsmt.SF)) +
…

SeanMc152
- 15
- 4
1
vote
1 answer
Order ggplot geom_point in order by date on X axis
I have a table of maximum trip lengths by month which I am trying to graph in R ,
While trying to graph it, the X-axis does not graph according to the month, instead it graphs it alphabetically
I'm just getting started in R and I used the…

Mandeep Manandhar
- 13
- 3
1
vote
2 answers
scale_fill versus scale_color for geom_point
I want to generate bubble plots where the bubbles have a black outline. However, for some reason, I'm having trouble getting geom_point to accept scale_fill. This gives me a nice plot where the bubble color scales with a continuous variable,…

user237554
- 79
- 8
1
vote
1 answer
geom_point() + geom_boxplot() for different colour/fill variable?
I am running the following code to generate a graph in which each point is coloured differently for each company per financial year according to a specific sequence. In the background, there is also a boxplot for each financial year.
library(dplyr);…

Daniela Rodrigues
- 545
- 3
- 17
1
vote
2 answers
How can I color one specific regression line among many in ggplot to match annotation?
I'm pretty aware of how to color a bunch of regression lines at once as well as faceting the color by groups. My main issue is coloring a specific regression among many faceted regression lines, akin to something like below:
First, my…

Shawn Hemelstrand
- 2,676
- 4
- 17
- 30
1
vote
1 answer
How to combine geom_map and geom_point in ggplot2
I am trying to combine geom_map and geom_point in ggplot2 using 2 data frames. When running the first part with geom_point only, I get the right plot. When running both combined geoms_ I get the error:
"Don't know how to automatically pick scale…

Patrick Stephenson
- 88
- 5
1
vote
1 answer
How to connect points with lines ggplot
I want to connect the dots corresponds to each year with a line.
The dataframe:
canc_noncanc_df <- data.frame(
Airline_Name = as.character(c("AA", "AS", "B6","CO", "DH", "DL", "EV", "FL", "HA", "HP", "MQ",
"NW", "OH", "OO", "TZ", "UA", "US",…

ArgyGr
- 57
- 7
1
vote
2 answers
use scale_fill_manual in R for a specific layer of layers in ggplot
I have trouble for plotting my raster and some points as sf object over that. I use aes(color=...) to assign color to different types of my points. But I want to change the colours to specific ones like red and blue and yellow. also I can't use…

Ali Abd
- 11
- 3
1
vote
1 answer
Rearrange geom_point by size
I have a variable (-coef-) that is just regression coefficient values. I am hoping to arrange all the -var- (variables of different models) in my plot based on the size of their respective -coef- values. I have tried various solutions using…

a_todd12
- 449
- 2
- 12
1
vote
1 answer
How do I add legends when there are two y variables?
This is the code I used:
ggplot(Delays2006, aes(Month)) + geom_point(aes(y = delay), color = "blue", size = 2)
+ geom_point(aes(y=delay2)) + scale_x_discrete(limits=(month.name))
+ labs(x= "Months", y = "Delays in minutes") + ggtitle(" Flight Data…

jerry
- 21
- 4
1
vote
1 answer
legend not appearing for ggplot geom_point color aesthetics
I am attempting to generate a legend for ggplot geom_point color aesthetics. I have tried various combinations and browsed through already asked questions but have not come up with a solution.
library (tidyverse)
library (ggplot2)
df <-…

KP1
- 129
- 2
- 8
1
vote
1 answer
Strange behavior with ggplots geom_point in for loop
I am using ggplot and gridExtra to make two plots side by side with different data, and I'm observing an unexpected behavior when using vector to make the plot instead of a dataframe.
Here is MWE with my…

pgaluzio
- 168
- 2
- 6
1
vote
2 answers
Why geom_line data is not plotting according to the secondary axis created in R?
I have adjusted the secondary axis to the units adding a coefficient /100. However, the datapoint (B) are not being plotted according to the secondary axis and remain small.
data<- data.frame(
Days=(1:10),
A=c(34,1,22,1,3,0,2,5,0,8),
…

Ecg
- 908
- 1
- 10
- 28
1
vote
2 answers
separating geom_point and geom_line in legend
I have a dataset with columns and points superimposed. The plotting is fairly simple but I can't seem to get geom_point to appear as a separate legend. Instead it defaults to combining the two.
I have tried adding the points as separate dataframe,…