Version 2.1.1 Released
This article is originally published at http://www.ggtern.com
Hi Folks, ggtern v2.1.1
has just been submitted to CRAN. This includes a number of minor bug fixes, and an additional annotation, permitting the rendering of raster data, say for the inclusion of images. This post will demonstrate the use of this requested feature.
Demonstration of Raster Annotation
Several people have asked me how they can overlay their new data over the top of an existing ternary diagram, say from a publication and the like. Included in this ggtern 2.1.1 is raster-array data for Figure 6 from Elkins and Groves Feldspar[1], lets dive in and demonstrate how to overlay some fresh points over this existing figure, for the sake of convenience, lets use the data from the same paper for the points themselves.:
#Load necessary libraries library(ggtern) #Load the Datasets data(Feldspar) data(FeldsparRaster) #Build the Plot ggtern(Feldspar,aes(Ab,An,Or)) + theme_rgbw() + theme_nogrid() + theme_legend_position() + annotation_raster_tern(FeldsparRaster,xmin=0,xmax=1,ymin=0,ymax=1) + geom_mask() + geom_point(size=5,aes(shape=Feldspar,fill=Feldspar),color='black') + scale_shape_manual(values=c(21,24)) + labs(title="Demonstration of Raster Annotation")
This produces the following result:
If people have suggestions for further additions, I welcome this input, and as usual, if this package has assisted you in your work, please feel free to contribute to my beer fund via the donations link at the top of the page.
References
[Bibtex]
@Article{elkins1990ternary,
Title = {Ternary Feldspar Experiments and Thermodynamic Models},
Author = {Elkins, Linda T and Grove, Timothy L},
Journal = {American Mineralogist},
Year = {1990},
Number = {5-6},
Pages = {544--559},
Volume = {75},
File = {elkins1990ternary.pdf:Users/nick/Copy/UNSW/PhD/References/Referenced/elkins1990ternary.pdf:PDF},
Owner = {Nick Hamilton},
Publisher = {Mineral Soc America},
Timestamp = {20140123}
}
The post Version 2.1.1 Released appeared first on ggtern: ternary diagrams in R.
Thanks for visiting r-craft.org
This article is originally published at http://www.ggtern.com
Please visit source website for post related comments.