Type: | Package |
Title: | Pretty Base Graphics |
Version: | 0.2.2 |
Maintainer: | Colin Gillespie <csgillespie@gmail.com> |
Description: | Drop-in replacements for standard base graphics functions. The replacements are prettier versions of the originals. |
License: | GPL-2 | GPL-3 |
URL: | https://github.com/jumpingrivers/prettyB/ |
BugReports: | https://github.com/jumpingrivers/prettyB/issues |
Imports: | graphics, grDevices, stats |
Suggests: | covr, knitr, lintr, rmarkdown, testthat, vdiffr |
VignetteBuilder: | knitr |
Encoding: | UTF-8 |
LazyData: | true |
RoxygenNote: | 7.1.1 |
NeedsCompilation: | no |
Packaged: | 2021-02-10 13:01:19 UTC; ncsg3 |
Author: | Colin Gillespie [aut, cre] |
Repository: | CRAN |
Date/Publication: | 2021-02-10 13:50:03 UTC |
The prettyB package
Description
Anyone who uses R Base graphics, have a 100 and 1 tweaks that they use to make the figures more presentable. This package aims to capture the tweaks in one place. By masking_standard plotting functions, we can automatically make base graphics a bit more pretty.
Author(s)
See Also
https://github.com/jumpingrivers/prettyB
Add tick marks to x/y axis A nicer set of default tick marks
Description
Add tick marks to x/y axis
A nicer set of default tick marks
Usage
add_x_axis(ticks_x, labels = ticks_x, tick = TRUE, lwd = 0, lwd.ticks = 1)
add_y_axis(ticks_y, labels = ticks_y, tick = TRUE, lwd = 0, lwd.ticks = 1)
Arguments
ticks_x |
location of x tick mark |
labels |
tick label |
tick |
Display tick mark |
lwd |
width of line |
lwd.ticks |
width of tick mark |
ticks_y |
location of y tick mark |
PrettyB barplot.default function
Description
This function overrides the default arguments. See
?graphics::barplot.default
Usage
## S3 method for class 'prettyB'
barplot(
height,
width = 1,
space = NULL,
names.arg = NULL,
legend.text = NULL,
beside = FALSE,
horiz = FALSE,
density = NULL,
angle = 45,
col = NULL,
border = par("fg"),
main = NULL,
sub = NULL,
xlab = NULL,
ylab = NULL,
xlim = NULL,
ylim = NULL,
xpd = TRUE,
log = "",
axes = TRUE,
axisnames = TRUE,
cex.axis = par("cex.axis"),
cex.names = par("cex.axis"),
inside = TRUE,
plot = TRUE,
axis.lty = 0,
offset = 0,
add = FALSE,
args.legend = NULL,
...
)
barplot_p(
height,
width = 1,
space = NULL,
names.arg = NULL,
legend.text = NULL,
beside = FALSE,
horiz = FALSE,
density = NULL,
angle = 45,
col = NULL,
border = par("fg"),
main = NULL,
sub = NULL,
xlab = NULL,
ylab = NULL,
xlim = NULL,
ylim = NULL,
xpd = TRUE,
log = "",
axes = TRUE,
axisnames = TRUE,
cex.axis = par("cex.axis"),
cex.names = par("cex.axis"),
inside = TRUE,
plot = TRUE,
axis.lty = 0,
offset = 0,
add = FALSE,
args.legend = NULL,
...
)
Arguments
height , width , space |
See |
names.arg , legend.text , beside |
See |
horiz , density , angle , col |
See |
border , main , sub , xlab , ylab |
See |
xlim , ylim , xpd , log , axes |
See |
axisnames , cex.axis , cex.names |
See |
inside , plot , axis.lty |
See |
offset , add , args.legend |
See |
... |
See |
Examples
barplot(VADeaths)
PrettyB boxplot.default function
Description
This function overrides the default arguments. See
?graphics::boxplot.default
Usage
## S3 method for class 'prettyB'
boxplot(
x,
...,
range = 1.5,
width = NULL,
varwidth = FALSE,
notch = FALSE,
outline = TRUE,
names,
plot = TRUE,
border = par("fg"),
col = NULL,
log = "",
pars = list(boxwex = 0.8, staplewex = 0.5, outwex = 0.5),
horizontal = FALSE,
add = FALSE,
at = NULL
)
boxplot_p(
x,
...,
range = 1.5,
width = NULL,
varwidth = FALSE,
notch = FALSE,
outline = TRUE,
names,
plot = TRUE,
border = par("fg"),
col = NULL,
log = "",
pars = list(boxwex = 0.8, staplewex = 0.5, outwex = 0.5),
horizontal = FALSE,
add = FALSE,
at = NULL
)
Arguments
x , ... , range , width |
See |
varwidth , notch , outline |
See |
names , plot , border |
See |
col , log , pars |
See |
horizontal , add , at |
See |
PrettyB hist.default function
Description
This function overrides the default arguments. See
?graphics::hist.default
Usage
## S3 method for class 'prettyB'
hist(
x,
breaks = "Sturges",
freq = NULL,
probability = !freq,
include.lowest = TRUE,
right = TRUE,
density = NULL,
angle = 45,
col = NULL,
border = NULL,
main = paste("Histogram of", xname),
xlim = range(breaks),
ylim = NULL,
xlab = xname,
ylab,
axes = TRUE,
plot = TRUE,
labels = FALSE,
nclass = NULL,
warn.unused = TRUE,
...
)
hist_p(
x,
breaks = "Sturges",
freq = NULL,
probability = !freq,
include.lowest = TRUE,
right = TRUE,
density = NULL,
angle = 45,
col = NULL,
border = NULL,
main = paste("Histogram of", xname),
xlim = range(breaks),
ylim = NULL,
xlab = xname,
ylab,
axes = TRUE,
plot = TRUE,
labels = FALSE,
nclass = NULL,
warn.unused = TRUE,
...
)
Arguments
x , breaks , freq , probability |
See |
include.lowest , right , density |
See |
angle , col , border , main |
See |
xlim , ylim , xlab , ylab , axes , plot |
See |
labels , nclass , warn.unused |
See |
... |
See |
Examples
x = rlnorm(100)
hist(x)
PrettyB plot.default function
Description
This function overrides the default arguments. See
?graphics::plot.default
Usage
## S3 method for class 'prettyB'
plot(
x,
y = NULL,
type = "p",
xlim = NULL,
ylim = NULL,
log = "",
main = NULL,
sub = NULL,
xlab = NULL,
ylab = NULL,
ann = par("ann"),
axes = TRUE,
frame.plot = axes,
panel.first = NULL,
panel.last = NULL,
asp = NA,
...
)
plot_p(
x,
y = NULL,
type = "p",
xlim = NULL,
ylim = NULL,
log = "",
main = NULL,
sub = NULL,
xlab = NULL,
ylab = NULL,
ann = par("ann"),
axes = TRUE,
frame.plot = axes,
panel.first = NULL,
panel.last = NULL,
asp = NA,
...
)
Arguments
x , y , type , log |
See |
xlim , ylim |
See |
main , sub , xlab , ylab |
See |
ann , axes |
See |
frame.plot , panel.first , panel.last |
See |
asp |
See |
... |
See |
Examples
plot_p(1:10, 1:10)
Set up par and palette Sets up par and palette
Description
Set up par and palette
Sets up par and palette
Usage
reset_prettyB()
setup_prettyB()