Commit 0f16be79 authored by POTTIER Francois's avatar POTTIER Francois
Browse files

One more plot.

parent 326b3db7
......@@ -4,21 +4,35 @@ require(ggplot2)
# Load our data.
mydata <- read.csv("data.csv")
# Restrict ourselves to a subset of the data.
mydata <- subset(mydata, time >= 0.1)
# A function that creates a scatter plot. Data on the X and Y axes
# is determined by the argument [xy]. The scale is logarithmic.
# [lx] and [ly] are labels for the axes.
plotloglog <- function(xy, lx, ly) {
ggplot(mydata, xy) +
geom_point(size=3) +
scale_x_log10() +
scale_y_log10() +
xlab(lx) +
ylab(ly)
}
# Plot.
myplot <- plotloglog(aes(x=lr1states, y=time), "# LR(1) states", "time (seconds)")
ggsave("lr1states-time.pdf", myplot, width=12, height=8, units="cm")
# ------------------------------------------------------------------------------
# Plot the LR(1) construction time.
myplot <-
ggplot(
subset(mydata, lr1time >= 0.1),
aes(x=lr1states, y=lr1time)
) +
geom_point(size=2) +
# scale_x_log10() +
# scale_y_log10() +
xlab("# LR(1) states") +
ylab("LR(1) construction time (seconds)")
ggsave("lr1states-lr1time.pdf", myplot, width=12, height=8, units="cm")
# ------------------------------------------------------------------------------
# Plot the numbers of terminal and nonterminal symbols.
myplot <-
ggplot(
mydata,
aes(x=terminals, y=nonterminals)
) +
geom_point(size=2) +
xlab("# terminals") +
ylab("# nonterminals")
ggsave("terminals-nonterminals.pdf", myplot, width=12, height=8, units="cm")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment