Hello,
I want to plot two graph in the same picture with the function plot().
Graph 1 is a graph of the Line. I used arrows fonction
Graph 2 is read with st_read and plotted with plot
My probleme is that is not possible to overlay the Line on my background.
Plot(bkg)
Plot(Line,add=TRUE)
Have you an idea ?
Thanks in advance
1 Like
sbl_bah
January 30, 2020, 11:34am
2
I don't know if my previous e-mail is clear.
More détail, the Line is plotted but under my background.
Hi!
To help us help you, could you please prepare a repr oducible ex ample (reprex) illustrating your issue? Please have a look at this guide, to see how to create one:
A minimal reproducible example consists of the following items:
A minimal dataset, necessary to reproduce the issue
The minimal runnable code necessary to reproduce the issue, which can be run
on the given dataset, and including the necessary information on the used packages.
Let's quickly go over each one of these with examples:
Minimal Dataset (Sample Data)
You need to provide a data frame that is small enough to be (reasonably) pasted on a post, but big enough to reproduce your issue.
Let's say, as an example, that you are working with the iris data frame
head(iris)
#> Sepal.Length Sepal.Width Petal.Length Petal.Width Species
#> 1 5.1 3.5 1.4 0.…
Oyugi
January 30, 2020, 1:15pm
4
Hi,
Try use the function par(mfrow) before both plots. That will create a multi-paneled plotting window for you.
Thanks.
I tried to use par(mfrow) and i have error message
Error in par(mfrow) : object not found
You will find hereafter a part of my program :
plot.new()
plot(st_geometry(map),col="blue")
cartograflow::flowmap()
flowmap uses the arrows () function
the output of the function flowmap is the line plotting.
TomasG
January 31, 2020, 1:06am
7
Can you make a reproducible example of your data and the code of your two graphs? This would be a great input to help you!
Also you can check for the par( ) and layout( ) function.
Hi, I found a solution to my problem. I used the background transparency include in par()
.
In this case, I can overlay two pictures.
par(bg="NA")
plot(st_geometry(map),col="blue")
par(new=TRUE)
flowmap(tab=flow,...)
dev.off()
Thanks to your help.
1 Like
system
Closed
February 9, 2020, 4:20pm
9
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.