[R-sig-Geo] Leader lines for inset map

Vladimir sendmeoffer at gmail.com
Mon Nov 3 11:22:14 CET 2014


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:
>
> I don't think you'll get a complete solution from this mailing list 
> until you tell us how you are drawing your maps in the first place.
>
> Are you using base graphics plotting, or ggplot, or ggmap, or lattice? 
> Could you throw us a few lines of code that show how you make your 
> base and insert maps? Otherwise you're going to get a bunch of "just 
> draw lines" answers...
>
> On 1 Nov 2014 20:07, "Vladimir" <sendmeoffer at gmail.com 
> <mailto:sendmeoffer at gmail.com>> wrote:
>
>     Hello list!
>
>     I would like to add leader lines to my inset maps. These lines connect
>     the frame of the inset map with the corresponding area on the main
>     map.
>     Good examples are here [1], [2], or here [3].
>
>     What is the most convenient R approach to do so?
>
>     Kind regards,
>     Vladimir.
>
>     ---
>     [1]
>     http://gce-lter.marsci.uga.edu/public/images/gce_study_area_blowup_nov07_rev.jpg
>     [2] http://pubs.usgs.gov/fs/fs08203/images/study_area.gif
>     [3]
>     http://www.innovativegis.com/basis/supplements/bm_dec_02/Ironing_Colorado_files/image004.jpg
>
>     _______________________________________________
>     R-sig-Geo mailing list
>     R-sig-Geo at r-project.org <mailto:R-sig-Geo at r-project.org>
>     https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>


	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list