New Geometry – Confidence Regions

Advanced Case

The above example is a basic case, however, the following is an example of what can be done with this new geometry, representing several variables and groupings.

plot of chunk unnamed-chunk-3

Code for the above:

#Build the plot
plot <- ggtern(data = Feldspar, aes(An, Ab, Or, group = Feldspar)) +

        #The new geometry
        geom_confidence(linetype = 1,
                        breaks = c(0.5, 0.75, 0.9, 0.95, 0.99, 0.999),
                        n = 2000,
                        fill = "black",
                        aes(alpha = (1 - ..level..), color = ..level..)) +

        #The rest is existing.
        geom_point(aes(shape = Feldspar,
                       fill = T.C,
                       size = P.Gpa),   color = "black") +
        scale_fill_gradient(low = "green", high = "red") +
        scale_size_continuous(range = c(2.5, 7.5)) +
        scale_alpha_identity() +
        scale_color_gradient(low = "black", high = "magenta") +
        scale_shape_manual(values = c(21, 24)) +
        labs(title = 'Feldspar - Elkins and Grove 1990 + Confidence Levels',
             fill = 'T/C',
             size = 'P/Gpa',
             color = 'Confidence') +
        guides(shape = guide_legend(order = 1, override.aes = list(size = 5)),
               size = guide_legend(order = 2),
               fill = guide_colourbar(order = 3),
               color = guide_colourbar(order = 4)) +
        theme_tern_bw() +
        theme(legend.position = c(0, 1),
              legend.justification = c(0, 1),
              legend.box.just = "left") +
        weight_percent()

#render
plot
Facebooktwitterredditlinkedinmail
Comments
  1. bandar-sbobet
  2. link alternatif mabosbet
  3. mabosbet
  4. agenmaxbet.net
  5. l69
  6. space513.com

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.