phasePropPlot {GCDkit}R Documentation

Stacked barplot of temperature vs. phase proportions.

Description

This function makes a stacked barplot of phase proportions, typically of minerals with, or without, melt.

Usage

    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="")

Arguments

mat

a numeric matrix with phase proportions in columns, and temperature in C in rows.

renormalize

logical, should be the data in mat renormalized to a sum of 1?

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.

Details

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.

phasePropPlot.png

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

Value

sheet

list with Figaro Style Sheet data.

x.data

See Details.

y.data

See Details.

Author(s)

Vojtěch Janoušek, vojtech.janousek@geology.cz

See Also

figaro

Examples

    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")

[Package GCDkit version 6.1 Index]