Leaving the path open from geom_path
up vote
1
down vote
favorite
I am plotting data on a coastline map using geom_path and I can't remove the line linking the first and last data point. The data set for this is quite large but can be found here.
The problem was reported and fixed on this thread, although it didn't help in my case.
LHplot <- ggplot(data = LH, aes(x = long, y = lat, group=group)) +
geom_path(aes(group=group), size = 1, color = "darkgrey") +
theme_bw() +
theme(axis.line.y=element_blank(),
axis.line.x = element_blank(),
axis.title.x = element_blank(),
axis.title.y = element_blank(),
axis.text = element_blank(),
axis.ticks = element_blank(),
panel.grid.major = element_blank(), # switch off major gridlines
panel.grid.minor = element_blank(), # switch off minor gridlines
panel.border = element_blank(),
text=element_text(family="Times New Roman", size=11)
)
LHplot
I also noticed that when plotting a subset of the data, the path may or not be open
LH2 <- LH[1:16000,]
LH2plot <- ggplot(data = LH2, aes(x = long, y = lat, group=group)) +
geom_path(aes(group=group), size = 1, color = "darkgrey") +
theme_bw() +
theme(axis.line.y=element_blank(),
axis.line.x = element_blank(),
axis.title.x = element_blank(),
axis.title.y = element_blank(),
axis.text = element_blank(),
axis.ticks = element_blank(),
panel.grid.major = element_blank(), # switch off major gridlines
panel.grid.minor = element_blank(), # switch off minor gridlines
panel.border = element_blank(),
text=element_text(family="Times New Roman", size=11)
)
LH2plot
LH2 <- LH[1:50000,]
LH2plot <- ggplot(data = LH2, aes(x = long, y = lat, group=group)) +
geom_path(aes(group=group), size = 1, color = "darkgrey") +
theme_bw() +
theme(axis.line.y=element_blank(),
axis.line.x = element_blank(),
axis.title.x = element_blank(),
axis.title.y = element_blank(),
axis.text = element_blank(),
axis.ticks = element_blank(),
panel.grid.major = element_blank(), # switch off major gridlines
panel.grid.minor = element_blank(), # switch off minor gridlines
panel.border = element_blank(),
text=element_text(family="Times New Roman", size=11)
)
LH2plot
Does the problem come from gaps in the data set? or simply the way it is organized in the data frame and how geom_path reads it?
Edit
From the comment below: I sorted the data by latitude to draw the path from south to north:
LH <- LH[order(LH$lat),]
Which fixes the line problem, but creates another problem:
r ggplot2 rgdal maptools
add a comment |
up vote
1
down vote
favorite
I am plotting data on a coastline map using geom_path and I can't remove the line linking the first and last data point. The data set for this is quite large but can be found here.
The problem was reported and fixed on this thread, although it didn't help in my case.
LHplot <- ggplot(data = LH, aes(x = long, y = lat, group=group)) +
geom_path(aes(group=group), size = 1, color = "darkgrey") +
theme_bw() +
theme(axis.line.y=element_blank(),
axis.line.x = element_blank(),
axis.title.x = element_blank(),
axis.title.y = element_blank(),
axis.text = element_blank(),
axis.ticks = element_blank(),
panel.grid.major = element_blank(), # switch off major gridlines
panel.grid.minor = element_blank(), # switch off minor gridlines
panel.border = element_blank(),
text=element_text(family="Times New Roman", size=11)
)
LHplot
I also noticed that when plotting a subset of the data, the path may or not be open
LH2 <- LH[1:16000,]
LH2plot <- ggplot(data = LH2, aes(x = long, y = lat, group=group)) +
geom_path(aes(group=group), size = 1, color = "darkgrey") +
theme_bw() +
theme(axis.line.y=element_blank(),
axis.line.x = element_blank(),
axis.title.x = element_blank(),
axis.title.y = element_blank(),
axis.text = element_blank(),
axis.ticks = element_blank(),
panel.grid.major = element_blank(), # switch off major gridlines
panel.grid.minor = element_blank(), # switch off minor gridlines
panel.border = element_blank(),
text=element_text(family="Times New Roman", size=11)
)
LH2plot
LH2 <- LH[1:50000,]
LH2plot <- ggplot(data = LH2, aes(x = long, y = lat, group=group)) +
geom_path(aes(group=group), size = 1, color = "darkgrey") +
theme_bw() +
theme(axis.line.y=element_blank(),
axis.line.x = element_blank(),
axis.title.x = element_blank(),
axis.title.y = element_blank(),
axis.text = element_blank(),
axis.ticks = element_blank(),
panel.grid.major = element_blank(), # switch off major gridlines
panel.grid.minor = element_blank(), # switch off minor gridlines
panel.border = element_blank(),
text=element_text(family="Times New Roman", size=11)
)
LH2plot
Does the problem come from gaps in the data set? or simply the way it is organized in the data frame and how geom_path reads it?
Edit
From the comment below: I sorted the data by latitude to draw the path from south to north:
LH <- LH[order(LH$lat),]
Which fixes the line problem, but creates another problem:
r ggplot2 rgdal maptools
I think its just the way its ordered.geom_path
will plot them based on the order presented in the data.frame rows. I don't thinkgroup
should serve any purpose here as you are producing one line segment. If possible I would set the order of the rows from the start of the country sketch, to the end and then use geom_path without group. Should work ok
– Jonny Phelps
Nov 22 at 14:20
1
Problem is that your mainland group does not start in the south and end in the north, but starts just north of Trondheim, does the north and then starts at the south.
– Richard Telford
Nov 22 at 14:30
@JonnyPhelps thegroup
will keep the island separate from the mainland
– Richard Telford
Nov 22 at 14:31
ah right, I thought it was just one line, my mistake
– Jonny Phelps
Nov 22 at 14:34
@RichardTelford you're right about both the problem the geographic area well done! I did sort my data but it seems I have a problem with the fjords as illustrated in the edit. I'll try your answer.
– Drosof
Nov 22 at 14:52
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I am plotting data on a coastline map using geom_path and I can't remove the line linking the first and last data point. The data set for this is quite large but can be found here.
The problem was reported and fixed on this thread, although it didn't help in my case.
LHplot <- ggplot(data = LH, aes(x = long, y = lat, group=group)) +
geom_path(aes(group=group), size = 1, color = "darkgrey") +
theme_bw() +
theme(axis.line.y=element_blank(),
axis.line.x = element_blank(),
axis.title.x = element_blank(),
axis.title.y = element_blank(),
axis.text = element_blank(),
axis.ticks = element_blank(),
panel.grid.major = element_blank(), # switch off major gridlines
panel.grid.minor = element_blank(), # switch off minor gridlines
panel.border = element_blank(),
text=element_text(family="Times New Roman", size=11)
)
LHplot
I also noticed that when plotting a subset of the data, the path may or not be open
LH2 <- LH[1:16000,]
LH2plot <- ggplot(data = LH2, aes(x = long, y = lat, group=group)) +
geom_path(aes(group=group), size = 1, color = "darkgrey") +
theme_bw() +
theme(axis.line.y=element_blank(),
axis.line.x = element_blank(),
axis.title.x = element_blank(),
axis.title.y = element_blank(),
axis.text = element_blank(),
axis.ticks = element_blank(),
panel.grid.major = element_blank(), # switch off major gridlines
panel.grid.minor = element_blank(), # switch off minor gridlines
panel.border = element_blank(),
text=element_text(family="Times New Roman", size=11)
)
LH2plot
LH2 <- LH[1:50000,]
LH2plot <- ggplot(data = LH2, aes(x = long, y = lat, group=group)) +
geom_path(aes(group=group), size = 1, color = "darkgrey") +
theme_bw() +
theme(axis.line.y=element_blank(),
axis.line.x = element_blank(),
axis.title.x = element_blank(),
axis.title.y = element_blank(),
axis.text = element_blank(),
axis.ticks = element_blank(),
panel.grid.major = element_blank(), # switch off major gridlines
panel.grid.minor = element_blank(), # switch off minor gridlines
panel.border = element_blank(),
text=element_text(family="Times New Roman", size=11)
)
LH2plot
Does the problem come from gaps in the data set? or simply the way it is organized in the data frame and how geom_path reads it?
Edit
From the comment below: I sorted the data by latitude to draw the path from south to north:
LH <- LH[order(LH$lat),]
Which fixes the line problem, but creates another problem:
r ggplot2 rgdal maptools
I am plotting data on a coastline map using geom_path and I can't remove the line linking the first and last data point. The data set for this is quite large but can be found here.
The problem was reported and fixed on this thread, although it didn't help in my case.
LHplot <- ggplot(data = LH, aes(x = long, y = lat, group=group)) +
geom_path(aes(group=group), size = 1, color = "darkgrey") +
theme_bw() +
theme(axis.line.y=element_blank(),
axis.line.x = element_blank(),
axis.title.x = element_blank(),
axis.title.y = element_blank(),
axis.text = element_blank(),
axis.ticks = element_blank(),
panel.grid.major = element_blank(), # switch off major gridlines
panel.grid.minor = element_blank(), # switch off minor gridlines
panel.border = element_blank(),
text=element_text(family="Times New Roman", size=11)
)
LHplot
I also noticed that when plotting a subset of the data, the path may or not be open
LH2 <- LH[1:16000,]
LH2plot <- ggplot(data = LH2, aes(x = long, y = lat, group=group)) +
geom_path(aes(group=group), size = 1, color = "darkgrey") +
theme_bw() +
theme(axis.line.y=element_blank(),
axis.line.x = element_blank(),
axis.title.x = element_blank(),
axis.title.y = element_blank(),
axis.text = element_blank(),
axis.ticks = element_blank(),
panel.grid.major = element_blank(), # switch off major gridlines
panel.grid.minor = element_blank(), # switch off minor gridlines
panel.border = element_blank(),
text=element_text(family="Times New Roman", size=11)
)
LH2plot
LH2 <- LH[1:50000,]
LH2plot <- ggplot(data = LH2, aes(x = long, y = lat, group=group)) +
geom_path(aes(group=group), size = 1, color = "darkgrey") +
theme_bw() +
theme(axis.line.y=element_blank(),
axis.line.x = element_blank(),
axis.title.x = element_blank(),
axis.title.y = element_blank(),
axis.text = element_blank(),
axis.ticks = element_blank(),
panel.grid.major = element_blank(), # switch off major gridlines
panel.grid.minor = element_blank(), # switch off minor gridlines
panel.border = element_blank(),
text=element_text(family="Times New Roman", size=11)
)
LH2plot
Does the problem come from gaps in the data set? or simply the way it is organized in the data frame and how geom_path reads it?
Edit
From the comment below: I sorted the data by latitude to draw the path from south to north:
LH <- LH[order(LH$lat),]
Which fixes the line problem, but creates another problem:
r ggplot2 rgdal maptools
r ggplot2 rgdal maptools
edited Nov 26 at 8:26
asked Nov 22 at 14:01
Drosof
6610
6610
I think its just the way its ordered.geom_path
will plot them based on the order presented in the data.frame rows. I don't thinkgroup
should serve any purpose here as you are producing one line segment. If possible I would set the order of the rows from the start of the country sketch, to the end and then use geom_path without group. Should work ok
– Jonny Phelps
Nov 22 at 14:20
1
Problem is that your mainland group does not start in the south and end in the north, but starts just north of Trondheim, does the north and then starts at the south.
– Richard Telford
Nov 22 at 14:30
@JonnyPhelps thegroup
will keep the island separate from the mainland
– Richard Telford
Nov 22 at 14:31
ah right, I thought it was just one line, my mistake
– Jonny Phelps
Nov 22 at 14:34
@RichardTelford you're right about both the problem the geographic area well done! I did sort my data but it seems I have a problem with the fjords as illustrated in the edit. I'll try your answer.
– Drosof
Nov 22 at 14:52
add a comment |
I think its just the way its ordered.geom_path
will plot them based on the order presented in the data.frame rows. I don't thinkgroup
should serve any purpose here as you are producing one line segment. If possible I would set the order of the rows from the start of the country sketch, to the end and then use geom_path without group. Should work ok
– Jonny Phelps
Nov 22 at 14:20
1
Problem is that your mainland group does not start in the south and end in the north, but starts just north of Trondheim, does the north and then starts at the south.
– Richard Telford
Nov 22 at 14:30
@JonnyPhelps thegroup
will keep the island separate from the mainland
– Richard Telford
Nov 22 at 14:31
ah right, I thought it was just one line, my mistake
– Jonny Phelps
Nov 22 at 14:34
@RichardTelford you're right about both the problem the geographic area well done! I did sort my data but it seems I have a problem with the fjords as illustrated in the edit. I'll try your answer.
– Drosof
Nov 22 at 14:52
I think its just the way its ordered.
geom_path
will plot them based on the order presented in the data.frame rows. I don't think group
should serve any purpose here as you are producing one line segment. If possible I would set the order of the rows from the start of the country sketch, to the end and then use geom_path without group. Should work ok– Jonny Phelps
Nov 22 at 14:20
I think its just the way its ordered.
geom_path
will plot them based on the order presented in the data.frame rows. I don't think group
should serve any purpose here as you are producing one line segment. If possible I would set the order of the rows from the start of the country sketch, to the end and then use geom_path without group. Should work ok– Jonny Phelps
Nov 22 at 14:20
1
1
Problem is that your mainland group does not start in the south and end in the north, but starts just north of Trondheim, does the north and then starts at the south.
– Richard Telford
Nov 22 at 14:30
Problem is that your mainland group does not start in the south and end in the north, but starts just north of Trondheim, does the north and then starts at the south.
– Richard Telford
Nov 22 at 14:30
@JonnyPhelps the
group
will keep the island separate from the mainland– Richard Telford
Nov 22 at 14:31
@JonnyPhelps the
group
will keep the island separate from the mainland– Richard Telford
Nov 22 at 14:31
ah right, I thought it was just one line, my mistake
– Jonny Phelps
Nov 22 at 14:34
ah right, I thought it was just one line, my mistake
– Jonny Phelps
Nov 22 at 14:34
@RichardTelford you're right about both the problem the geographic area well done! I did sort my data but it seems I have a problem with the fjords as illustrated in the edit. I'll try your answer.
– Drosof
Nov 22 at 14:52
@RichardTelford you're right about both the problem the geographic area well done! I did sort my data but it seems I have a problem with the fjords as illustrated in the edit. I'll try your answer.
– Drosof
Nov 22 at 14:52
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
The problem is that your mainland coastline does not start at one end and go to the other, but starts somewhere in the middle.
First thing is to identify the jump. Below I identify it using latitude alone, but both latitude and longitude could be used together if needed (with geodesic distances) but that would be much more work for no gain.
Then we need to re-arrange the data, moving the rows from above the break to the end of the dataset (in this case because the rows go clockwise round Norway).
library(tidyverse)
#Find the largest change in latitude
LH %>%
group_by(group) %>%
mutate(llat = lag(lat), dlat = abs(lat - llat)) %>%
ungroup() %>%
mutate( n = 1:n()) %>%
slice(which.max(dlat))
#re-arrange data
bind_rows(LH %>% slice(-(1:16015)),
LH %>% slice(1:16015)) %>%
ggplot(aes(x = long, y = lat, group=group)) +
geom_path(size = 1, color = "darkgrey")
So far the results I get with your code does not produce this annoying closed path, but I still get annoyed with the fjords as illustrated in the edit.
– Drosof
Nov 22 at 14:59
1
I've updated to give a simpler answer. Works for me. Simply sorting the data won't work.
– Richard Telford
Nov 22 at 15:11
That worked like a charm, tusen takk @RichardTelford! Ideally, I would skip the fjords and draw a path on the outermost coastline to use it as an overlay on a map. Can it be an easy way to sort out the coordinates for the large fjords using tidyverse? I am not familiar with it.
– Drosof
Nov 22 at 18:15
Probably easiest to find a simplified map.
– Richard Telford
Nov 22 at 21:38
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
The problem is that your mainland coastline does not start at one end and go to the other, but starts somewhere in the middle.
First thing is to identify the jump. Below I identify it using latitude alone, but both latitude and longitude could be used together if needed (with geodesic distances) but that would be much more work for no gain.
Then we need to re-arrange the data, moving the rows from above the break to the end of the dataset (in this case because the rows go clockwise round Norway).
library(tidyverse)
#Find the largest change in latitude
LH %>%
group_by(group) %>%
mutate(llat = lag(lat), dlat = abs(lat - llat)) %>%
ungroup() %>%
mutate( n = 1:n()) %>%
slice(which.max(dlat))
#re-arrange data
bind_rows(LH %>% slice(-(1:16015)),
LH %>% slice(1:16015)) %>%
ggplot(aes(x = long, y = lat, group=group)) +
geom_path(size = 1, color = "darkgrey")
So far the results I get with your code does not produce this annoying closed path, but I still get annoyed with the fjords as illustrated in the edit.
– Drosof
Nov 22 at 14:59
1
I've updated to give a simpler answer. Works for me. Simply sorting the data won't work.
– Richard Telford
Nov 22 at 15:11
That worked like a charm, tusen takk @RichardTelford! Ideally, I would skip the fjords and draw a path on the outermost coastline to use it as an overlay on a map. Can it be an easy way to sort out the coordinates for the large fjords using tidyverse? I am not familiar with it.
– Drosof
Nov 22 at 18:15
Probably easiest to find a simplified map.
– Richard Telford
Nov 22 at 21:38
add a comment |
up vote
1
down vote
accepted
The problem is that your mainland coastline does not start at one end and go to the other, but starts somewhere in the middle.
First thing is to identify the jump. Below I identify it using latitude alone, but both latitude and longitude could be used together if needed (with geodesic distances) but that would be much more work for no gain.
Then we need to re-arrange the data, moving the rows from above the break to the end of the dataset (in this case because the rows go clockwise round Norway).
library(tidyverse)
#Find the largest change in latitude
LH %>%
group_by(group) %>%
mutate(llat = lag(lat), dlat = abs(lat - llat)) %>%
ungroup() %>%
mutate( n = 1:n()) %>%
slice(which.max(dlat))
#re-arrange data
bind_rows(LH %>% slice(-(1:16015)),
LH %>% slice(1:16015)) %>%
ggplot(aes(x = long, y = lat, group=group)) +
geom_path(size = 1, color = "darkgrey")
So far the results I get with your code does not produce this annoying closed path, but I still get annoyed with the fjords as illustrated in the edit.
– Drosof
Nov 22 at 14:59
1
I've updated to give a simpler answer. Works for me. Simply sorting the data won't work.
– Richard Telford
Nov 22 at 15:11
That worked like a charm, tusen takk @RichardTelford! Ideally, I would skip the fjords and draw a path on the outermost coastline to use it as an overlay on a map. Can it be an easy way to sort out the coordinates for the large fjords using tidyverse? I am not familiar with it.
– Drosof
Nov 22 at 18:15
Probably easiest to find a simplified map.
– Richard Telford
Nov 22 at 21:38
add a comment |
up vote
1
down vote
accepted
up vote
1
down vote
accepted
The problem is that your mainland coastline does not start at one end and go to the other, but starts somewhere in the middle.
First thing is to identify the jump. Below I identify it using latitude alone, but both latitude and longitude could be used together if needed (with geodesic distances) but that would be much more work for no gain.
Then we need to re-arrange the data, moving the rows from above the break to the end of the dataset (in this case because the rows go clockwise round Norway).
library(tidyverse)
#Find the largest change in latitude
LH %>%
group_by(group) %>%
mutate(llat = lag(lat), dlat = abs(lat - llat)) %>%
ungroup() %>%
mutate( n = 1:n()) %>%
slice(which.max(dlat))
#re-arrange data
bind_rows(LH %>% slice(-(1:16015)),
LH %>% slice(1:16015)) %>%
ggplot(aes(x = long, y = lat, group=group)) +
geom_path(size = 1, color = "darkgrey")
The problem is that your mainland coastline does not start at one end and go to the other, but starts somewhere in the middle.
First thing is to identify the jump. Below I identify it using latitude alone, but both latitude and longitude could be used together if needed (with geodesic distances) but that would be much more work for no gain.
Then we need to re-arrange the data, moving the rows from above the break to the end of the dataset (in this case because the rows go clockwise round Norway).
library(tidyverse)
#Find the largest change in latitude
LH %>%
group_by(group) %>%
mutate(llat = lag(lat), dlat = abs(lat - llat)) %>%
ungroup() %>%
mutate( n = 1:n()) %>%
slice(which.max(dlat))
#re-arrange data
bind_rows(LH %>% slice(-(1:16015)),
LH %>% slice(1:16015)) %>%
ggplot(aes(x = long, y = lat, group=group)) +
geom_path(size = 1, color = "darkgrey")
edited Nov 22 at 15:09
answered Nov 22 at 14:45
Richard Telford
5,76242335
5,76242335
So far the results I get with your code does not produce this annoying closed path, but I still get annoyed with the fjords as illustrated in the edit.
– Drosof
Nov 22 at 14:59
1
I've updated to give a simpler answer. Works for me. Simply sorting the data won't work.
– Richard Telford
Nov 22 at 15:11
That worked like a charm, tusen takk @RichardTelford! Ideally, I would skip the fjords and draw a path on the outermost coastline to use it as an overlay on a map. Can it be an easy way to sort out the coordinates for the large fjords using tidyverse? I am not familiar with it.
– Drosof
Nov 22 at 18:15
Probably easiest to find a simplified map.
– Richard Telford
Nov 22 at 21:38
add a comment |
So far the results I get with your code does not produce this annoying closed path, but I still get annoyed with the fjords as illustrated in the edit.
– Drosof
Nov 22 at 14:59
1
I've updated to give a simpler answer. Works for me. Simply sorting the data won't work.
– Richard Telford
Nov 22 at 15:11
That worked like a charm, tusen takk @RichardTelford! Ideally, I would skip the fjords and draw a path on the outermost coastline to use it as an overlay on a map. Can it be an easy way to sort out the coordinates for the large fjords using tidyverse? I am not familiar with it.
– Drosof
Nov 22 at 18:15
Probably easiest to find a simplified map.
– Richard Telford
Nov 22 at 21:38
So far the results I get with your code does not produce this annoying closed path, but I still get annoyed with the fjords as illustrated in the edit.
– Drosof
Nov 22 at 14:59
So far the results I get with your code does not produce this annoying closed path, but I still get annoyed with the fjords as illustrated in the edit.
– Drosof
Nov 22 at 14:59
1
1
I've updated to give a simpler answer. Works for me. Simply sorting the data won't work.
– Richard Telford
Nov 22 at 15:11
I've updated to give a simpler answer. Works for me. Simply sorting the data won't work.
– Richard Telford
Nov 22 at 15:11
That worked like a charm, tusen takk @RichardTelford! Ideally, I would skip the fjords and draw a path on the outermost coastline to use it as an overlay on a map. Can it be an easy way to sort out the coordinates for the large fjords using tidyverse? I am not familiar with it.
– Drosof
Nov 22 at 18:15
That worked like a charm, tusen takk @RichardTelford! Ideally, I would skip the fjords and draw a path on the outermost coastline to use it as an overlay on a map. Can it be an easy way to sort out the coordinates for the large fjords using tidyverse? I am not familiar with it.
– Drosof
Nov 22 at 18:15
Probably easiest to find a simplified map.
– Richard Telford
Nov 22 at 21:38
Probably easiest to find a simplified map.
– Richard Telford
Nov 22 at 21:38
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53432634%2fleaving-the-path-open-from-geom-path%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
I think its just the way its ordered.
geom_path
will plot them based on the order presented in the data.frame rows. I don't thinkgroup
should serve any purpose here as you are producing one line segment. If possible I would set the order of the rows from the start of the country sketch, to the end and then use geom_path without group. Should work ok– Jonny Phelps
Nov 22 at 14:20
1
Problem is that your mainland group does not start in the south and end in the north, but starts just north of Trondheim, does the north and then starts at the south.
– Richard Telford
Nov 22 at 14:30
@JonnyPhelps the
group
will keep the island separate from the mainland– Richard Telford
Nov 22 at 14:31
ah right, I thought it was just one line, my mistake
– Jonny Phelps
Nov 22 at 14:34
@RichardTelford you're right about both the problem the geographic area well done! I did sort my data but it seems I have a problem with the fjords as illustrated in the edit. I'll try your answer.
– Drosof
Nov 22 at 14:52