Version 2.1.1 Released

March 31, 2016

(This article was first published on ggtern: ternary diagrams in R, and kindly contributed to R-bloggers)

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

#Load the Datasets

#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.


[1] L. T. Elkins and T. L. Grove, “Ternary Feldspar Experiments and Thermodynamic Models,” American Mineralogist, vol. 75, iss. 5-6, pp. 544-559, 1990.
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.

To leave a comment for the author, please follow the link and comment on their blog: ggtern: ternary diagrams in R. offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...

If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.


Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)