Up: Component summary Function

HistogramPlot

Counts the frequencies and makes a line plot of histogram values

Version 1.1
Bundle tools
Categories Plot
Authors Ville Rantanen (ville.rantanen@helsinki.fi)
Issue tracker View/Report issues
Source files component.xml function.scala
Usage Example with default values

Inputs

Name Type Mandatory Description
in CSV Mandatory CSV to calculate frequencies
plotAnnotator RSource Optional R source file that is executed after the plot command. This can be used to add further elements to the plot. The current y and x values are available as numeric vectors "y.column" and "x.column". Current column names in y and x are available as strings "y.name" and "x.name". For example, "abline(h=max(y.column, na.rm=TRUE))" draws a horizontal line that intersects with the maximum Y coordinate.

Outputs

Name Type Description
frequencies CSV Frequencies
midpoints CSV Bin midpoints
out Latex The graph plotted

Parameters

Name Type Default Description
bins string "10" String to describe how to construct the bin edges. (R conventions, examples: "10" or "seq(0,1,length=21)" or "seq(mean(values)-3*sd(values),mean(values)+3*sd(values),length=31)"). Note that values not fitting in the sequence are REMOVED.
caption string "Histogram (%s)" LaTeX caption of each figure. The caption may contain one or two %s placeholders, which are replaced with the current column names in "y" and "x" (if defined). Column names are not used when multiple plots are created to the same image (imageType = 'single').
commonScale boolean true If true, all plots have the same limits for X and Y axes. This makes it easier to compare plots. Only relevant when multiple columns have been selected.
digits int 2 Number of digits shown in the x-axis of the histogram plot.
dpCm float 60 Dots per centimeter. Used for png-images.
drawX boolean true If false, do not print X axis ticks and numbers.
frequencyIsRatio boolean false Present histogram frequencies as ratio instead of absolute values.
height float 11 Height of each plot in cm.
imageType string "single" Plot multiple images = 'multiple', single image = 'single'
legendPosition string "off" Legend position 'bottomleft' or 'topright' etc.
plotPar string "" String to be evaluated in par() function. for example "bty='n', pch=7"
plotType string "hist" Plot type p=points, l=lines, h=line bars, step=step plot, bar=barplot, hist=histogram
pngImage boolean true Switch image format between png and pdf
sectionTitle string "Two dimensional plot" Title of the LaTeX section or an empty string to omit the section
sectionType string "subsection" Type of LaTeX section: usually one of section, subsection or subsubsection. No section statement is written if sectionTitle is empty.
title string "" Title for the plot
values string "*" Comma separated column names for values to create the histogram from.
width float 14 Width of each plot in cm.
xHigh float -0.000001 High bound of the X axis. The special value -0.000001 means that the bound is computed from the data.
xLabel string "" Name of the X axis
xLow float -0.000001 Low bound of the X axis. The special value -0.000001 means that the bound is computed from the data.
xTransformation string "" Numeric R expression that is used to transform X values. The X values are available as a numeric matrix (or vector) under the name "x". This is analogous to "yTransformation". xTransformation has no effect is "bar" plotType is used.
yHigh float -0.000001 High bound of the Y axis. The special value -0.000001 means that the bound is computed from the data.
yLabel string "Frequency" Name of the Y axis
yLow float -0.000001 Low bound of the Y axis. The special value -0.000001 means that the bound is computed from the data.
yTransformation string "" Numeric R expression that is used to transform Y values. The Y values are available as a numeric matrix (or vector) under the name "y". Only those columns are present that are selected using "yColumns". For example, "-log10(y)" transforms Y values using a negative base 10 logarithm (defined only for positive values). The expression may be any legal R expression that takes a numeric matrix (or vector) and produces a matrix (or vector) of the same size.

Test cases

Test case Parameters IN
in
IN
plotAnnotator
OUT
frequencies
OUT
midpoints
OUT
out
case1_line_plot properties in (missing) frequencies midpoints out

bins=0.5+(0:9),
legendPosition=bottomright,
plotType=l

case2_multiple_plots properties in (missing) frequencies midpoints out

bins=seq(0,10,length=15),
imageType=single,
plotType=bar,
commonScale=true

case3_nonlinear properties in plotAnnotator frequencies midpoints out

bins=log(seq(1,2,length=9))*max(values),
plotType=hist,
drawX=false,
values=Value


Generated 2019-02-08 07:42:21 by Anduril 2.0.0