plot two graph in the same graph

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

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 reproducible example (reprex) illustrating your issue? Please have a look at this guide, to see how to create one:

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.

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

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.