ternary_qmflt()
draws either a static or interactive ternary diagram, in english or spanish. It is a base diagram where data can be plotted.
ternary_qmflt( output = c("ggplot", "plotly"), language = c("en", "es"), opacity = 0.5 )
output | The output format: "ggplot" or "plotly" (default is "ggplot") |
---|---|
language | The language to be displayed: "en" for english or "es" for spanish (deafult is "en") |
opacity | Transparency level (default is 0.5) |
QmFLt ternary diagram for provenance analysis in the desired format (object)
For plotting data on the ggplot object it would be easier if the names of the dataframe are "f", "qm", and "lt", that way it gets mapped automatically, if not make sure to use "aes(x=f,y=qm,z=lt)".
For plotting on the plotly object the mapping of the new data should be as shown in the example: a = ~qm, b = ~f, c = ~lt
, where a
refers to the top ("qm"), b
refers to the bottom left ("f"), and c
refers to the bottom right ("lt").
The examples show basic usage and how to add data, which can be more customizable.
library(ggplot2) library(plotly) d = data.frame(qm=c(23,26.9,25.3), f=c(27,23.7,5.1), lt=c(50,49.4,59.6)) # adding data to ggplot object ternary_qmflt() + geom_point(data = d)