View source: R/particle_size_distribution.R
ggplot_psdchart | R Documentation |
Function to plot an empty particle size distribution chart. Default plots the range from clay all the way to boulders
ggplot_psdchart( trace_diameter = NULL, trace_passing = NULL, trace_group = NULL, crosshairs_diameter = NULL, crosshairs_passing = NULL, crosshairs_group = NULL, crosshairs_parse = NULL, palette = "Set1", legend_position = "none", legend_title = "", add_points = TRUE, height_labelbar = 0.075, percentage = TRUE, box_thickness = 0.25, textsize_primary = 2.5, textsize_secondary = 2, xlim = c(NA, NA) )
trace_diameter |
array with diameters for plotting traces |
trace_passing |
array with fractions passing for plotting traces |
trace_group |
array with grouping for plotting traces |
crosshairs_diameter |
diameter values of crosshairs to add |
crosshairs_passing |
fraction passing of crosshairs to add |
crosshairs_group |
crosshairs grouping + value for labels |
crosshairs_parse |
if 'TRUE', parse 'crosshairs_group' string in label |
palette |
RColorBrewer palette for plotting traces |
legend_position |
position for traces legend. names of traces are taken from the field 'group' |
legend_title |
title of the legend for traces |
add_points |
if 'TRUE', all points are plotted in addition to the lines of the traces |
height_labelbar |
height of single label bar above plot, relative to the height of the plot |
percentage |
if 'TRUE', plot percentages rather than fractions |
box_thickness |
thickness of label boxes |
textsize_primary |
size of labels, primary fraction |
textsize_secondary |
size of labels, fine/medium/course |
xlim |
user-defined x-axis limits |
a ggplot object
#empty chart ggplot_psdchart() #chart with two trace ggplot_psdchart( trace_diameter = c(0.01, 1, 100, 0.1, 1, 100), trace_passing = c(0.1, 0.5, 0.9, 0.2, 0.6, 0.9), trace_group = c(rep("A", 3), rep("B", 3)), legend_position = "right" ) #chart with one trace and some annotations ggplot_psdchart( trace_diameter = c(0.001, 0.01, 0.1, 1, 10, 100), trace_passing = c(0.05, 0.1, 0.2, 0.5, 0.6, 0.9), crosshairs_diameter = c(0.01, 1), crosshairs_passing = c(0.1, 0.5), crosshairs_group = c("D[10]==0.01~mm", "D[50]==1~mm"), crosshairs_parse = TRUE )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.