phasePropPlot {GCDkit} | R Documentation |
This function makes a stacked barplot of phase proportions, typically of minerals with, or without, melt.
phasePropPlot(mat, renormalize = TRUE, col = NULL, palette = "jet.colors", leg.pos = "bottomleft", leg.bg = "#FFFFFFAA", xlab = expression(Temperature~degree*C), ylab = "Phase proportions", xlim = NULL, ylim = c(0, 1), border = "white", main="")
mat |
a numeric matrix with phase proportions in columns, and temperature in C in rows. |
renormalize |
logical, should be the data in |
col |
list of colours for each of the phases. |
palette |
palette name. |
leg.pos |
position of the legend. |
leg.bg |
background colour for the legend. |
xlab |
character or expression; label for the x axis |
ylab |
character or expression; label for the y axis. |
xlim |
limits for the x axis. |
ylim |
limits for the y axis. |
border |
colour for the border for each of the bars. |
main |
character; main title for the plot. |
The input is a matrix with phase proportions in columns, their names in colnames and variable (by default a temperature in °C) in rownames.
If 'col = NULL
' and 'palette
' is specified, then the corresponding number of colours are
taken therefrom. Then the first column of data, typically a melt, is shown in gray.
The function assigns data for the diagram into a Figaro template
(list 'sheet
'), centers of intervals into 'x.data
' (not used for the x axis labeling)
and the plotting matrix into 'y.data
'.
The values for labeling the x axis are taken from rownames
of 'y.data
'.
sheet |
list with Figaro Style Sheet data. |
x.data |
See Details. |
y.data |
See Details. |
Vojtěch Janoušek, vojtech.janousek@geology.cz
min.prop<-matrix(c(0.1,0.2,0.5, 0.2,0.25,0.25, 0.5,0.4,0.15, 0.2,0.15,0.1), nrow=3,ncol=4,dimnames=list(seq(750,850,by=50),c("Liq","Cpx","Opx","Pl"))) phasePropPlot(min.prop,palette="jet.colors", ylab="vol. percent", main="Plot of mineral proportions") phasePropPlot(min.prop,col=1:4) phasePropPlot(min.prop,col=heat.colors(4)) data(blatna) accessVar("blatna") windows(10,5) i<-names(sort(WR[,"SiO2"])) phasePropPlot(WR[i,major],xlab="Sample")