Skip to content
Prev 21936 / 29559 Next

Leader lines for inset map

Hello!

The minimal example is
===== (source 
http://r-sig-geo.2731867.n2.nabble.com/making-an-inset-in-a-map-figure-tp7584585p7584618.html 
)

    |library(TeachingDemos)
    library(maptools)
    |

    ||
    |data(wrld_simpl)

    plot(wrld_simpl,border=NA,col='blue',axes=TRUE, xlim=c(100,130),
    ylim=c(-40,30))

    tmp <- subplot(
      plot(wrld_simpl,border=NA,col='green',bg='white',axes=FALSE),
        'bottomleft', size=c(2,1), inset=c(0.01,0.01))

    tmp2 <- par('usr')

    tmp3 <- subplot(
    plot(wrld_simpl, border='red', axes=TRUE, xlim=c(95,105),
    ylim=c(-5,5), bg='lightgrey'), 'topright', size=c(2,2))

    par(xpd=TRUE)  # reset clipping region
    rect( tmp3$usr[1], tmp3$usr[3], tmp3$usr[2], tmp3$usr[4],
    border='orange' )

    op <- par(tmp[c('plt','usr')])
    rect( tmp2[1], tmp2[3], tmp2[2], tmp2[4], border='red' )
    par(op)
    |

=====

I want to connect orange rectangle with topright inset map.

All the best,
Vladimir.
On 03/11/14 08:53, Barry Rowlingson wrote: