plot: Plot Binned Histogram and ECDF Data.

Description Usage Arguments Details Author(s) See Also Examples

Description

Produces aesthetically pleasing ECDF plots for two common classes of non-equiwidth histograms. Specifically, (1) histograms with power of two bucket boundaries commonly used in computer science for measuring resource usage, and (2) histograms with log-scaled time duration buckets with a range from 1 second to 10 years.

Usage

1
2
3
4
5
6
7
PlotLog2ByteEcdf(x, xlab="Bytes (log)",
                 ylab="Cumulative Fraction", with.grid=TRUE, ...)
PlotLogTimeDurationEcdf(x, with.grid=TRUE,
                        xlab="Age (log)",
                        ylab="Cumulative Fraction",
                        cex.lab=1.6,
                        cex.axis=1.6, ...)

Arguments

x

A "histogram" object (created by hist) representing a pre-binned dataset or an "ecdf" object (created by ecdf or HistToEcdf).

xlab

x-axis label for the Ecdf plot.

ylab

y-axis label for the Ecdf plot.

with.grid

Logical. If TRUE, draw faint grid lines on the ECDF plot.

cex.lab

Graphical parameters for plot and axes.

cex.axis

Graphical parameters for plot and axes.

...

Additional parameters are passed to plot().

Details

The PlotLog2ByteEcdf function takes a "histogram" or "ecdf" which has power of 2 bucket boundaries representing bytes and creates an Ecdf plot.

The PlotLogTimeDurationEcdf function takes a "histogram" or "ecdf" with exponential bucket boundaries representing seconds of age or duration and creates an Ecdf plot.

Author(s)

Murray Stokely mstokely@google.com

See Also

histogramtools-package, hist. ecdf.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
filename <- system.file("unitTests/data/buildkernel-readsize-dtrace.txt",
                         package="HistogramTools")
dtrace.hists <- ReadHistogramsFromDtraceOutputFile(filename)
x <- SubsetHistogram(dtrace.hists[["TOTAL"]], minbreak=1)
PlotLog2ByteEcdf(x, cex.lab=1.4)

x <- rexp(100000)
x <- x*(86400*300)/diff(range(x))

n <- as.integer(1+log2(max(x)))

h <- hist(x, breaks=c(0, unique(as.integer(2^seq(from=0, to=n, by=.25)))))
PlotLogTimeDurationEcdf(h)

Example output

Warning message:
In xy.coords(x, y, xlabel, ylabel, log) :
  1 x value <= 0 omitted from logarithmic plot

HistogramTools documentation built on May 2, 2019, 1:08 p.m.