Yes, thank You. If anyone else is interested, this works fine: souradnice_pop is a list containing various information about populations - coordinates, symbol and color to plot and so on. # Draw a map plot(x=getMap(resolution="high"), xlim=c(0,60), ylim=c(35,50), asp=1, lwd=1.5) # Draw a box around it box() # Plot map points points(souradnice_pop$X.lon, souradnice_pop$X.lat, pch=souradnice_pop[["symbol"]], col=souradnice_pop$col, cex=2) # Function text() doesn't allow to plot shaded background. Function boxed.labels() can do that, but it is not possible to move the text aside the point not to overlap it. So I tried shadowtest() It works fine, but it is necessary to play little bit wit the parameters. shadowtext(souradnice_pop$X.lon, souradnice_pop$X.lat, labels=souradnice_pop[["pop"]], col="black", bg="grey", theta=seq(pi/4,2*pi, length.out=8), r=0.2, pos=souradnice_pop[["offset"]], cex=1.1) # Plot a legend legend(x="topright", inset=1/50, legend=c("T. pyrrhopappum", "T. haussknechtii", "T. serotinum"), border="black", pch=c(15, 17, 19), pt.cex=2, bty="o", bg="lightgrey", box.lwd=2, cex=1.2, title="Species of Taraxacum sect. Dioszegia“) All the best, Vojtěch
Dne So 18. ledna 2014 16:58:15, Liam J. Revell napsal(a): > You might try investigating text to add labels to the plot and and > legend for a legend. Good luck! - Liam > > Liam J. Revell, Assistant Professor of Biology > University of Massachusetts Boston > web: http://faculty.umb.edu/liam.revell/ > email: liam.rev...@umb.edu > blog: http://blog.phytools.org > > On 1/13/2014 12:14 PM, Vojtěch Zeisek wrote: > > Hello, > > I have probably very silly question about maps of samples, but I'm not > > able to figure it out. :-( I wish to generate simple map showing sampling > > localities of sampled populations, with various symbols and colors for > > species and other characteristics. And with labels for the point showing > > population abbreviation and map legend explaining used symbols. > > To generate map I use > > plot(x=getMap(resolution="high"), xlim=c(0,60), ylim=c(35,50), asp=1, > > lwd=2) and to plot localities > > points(souradnice2$X.lon, souradnice2$X.lat, pch=souradnice2$symbol, > > col=souradnice2$col, cex=2) > > Variable „souradnice2“ contains details about localities: > > souradnice2 > > > > X.lon. X.lat. size col char symbol > > > > "D001" 2.9000 42.9167 big red Fe 15 > > [...] > > „D007“ 21.3333 41.1000 big blue He 17 > > [...] > > "D027" 20.8000 41.1333 big blue Oh 17 > > [...] > > "D053" 21.5167 41.9167 big blue Sk 17 > > "D054" 21.2833 41.9500 big blue Ma 17 > > "D055" 21.3667 41.9667 big blue So 17 > > "D056" 16.9832 48.9374 big yellow Ce 19 > > "D057" 16.9832 48.9374 big yellow Ce 19 > > [...] > > "D087" 16.6324 48.8380 big yellow Ba 19 > > "D088" 16.6324 48.8380 big yellow Ba 19 > > "D089" 16.9500 48.1250 big yellow Ha 19 > > "D090" 16.9500 48.1250 big yellow Ha 19 > > [...] > > "D109" 42.7167 49.9500 big yellow Po 19 > > "D110" 55.8917 37.3167 big yellow Ka 19 > > [...] > > I wasn't able to find how to plot also names of populations along the > > point and some legend summarizing symbols used to label populations. > > Could someone, please, point me to right way how to do it? > > All the best, > > Vojtěch -- Vojtěch Zeisek http://trapa.cz/en/ Department of Botany, Faculty of Science Charles University in Prague Benátská 2, Prague, 12801, CZ http://botany.natur.cuni.cz/en/ Institute of Botany, Academy of Science Zámek 1, Průhonice, 25243, CZ http://www.ibot.cas.cz/en/ Czech Republic
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ R-sig-phylo mailing list - R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/