Learn R Programming

smplot2 (version 0.2.5)

sm_hgrid: A minimalistic theme of horizontal major grids

Description

A graph with a horizontal grid is plotted. Border can be added or removed. This is useful for plotting a bar graph.

Usage

sm_hgrid(legends = FALSE, borders = TRUE)

Value

Returns a background theme with major horizontal grids (ggplot2 output).

Arguments

legends

If the legend needs to be displayed, the input should be TRUE. If the legend is not needed, the input should be FALSE.

borders

If the border needs to be displayed, the input should be TRUE. If the border is not needed, the input should be FALSE.

Examples

Run this code
library(ggplot2)
library(smplot2)
ggplot(data = mpg) +
geom_point(mapping = aes(x = displ, y = hwy, color = class)) +
sm_hgrid()

Run the code above in your browser using DataLab