Title: | Make 'ggplot2' Look Like 'gnuplot' |
Version: | 0.1.0 |
Description: | Provides a theme, a discrete color palette, and continuous scales to make 'ggplot2' look like 'gnuplot'. This may be helpful if you use both 'ggplot2' and 'gnuplot' in one project. |
Imports: | ggplot2 |
License: | MIT + file LICENSE |
URL: | https://github.com/hriebl/ggnuplot |
Encoding: | UTF-8 |
LazyData: | true |
RoxygenNote: | 7.1.0 |
NeedsCompilation: | no |
Packaged: | 2020-06-01 14:52:18 UTC; hannes |
Author: | Hannes Riebl [aut, cre] |
Maintainer: | Hannes Riebl <hriebl@uni-goettingen.de> |
Repository: | CRAN |
Date/Publication: | 2020-06-04 13:50:06 UTC |
The gnuplot color palette for discrete data, ported to ggplot2
Description
These functions provide gnuplot's default color palette.
Use scale_color_gnuplot()
and scale_fill_gnuplot()
with ggplot2,
and gnupalette()
or the vector gnucolors
otherwise.
Usage
scale_color_gnuplot(..., na.value = "gray50", aesthetics = "color")
scale_fill_gnuplot(..., na.value = "gray50", aesthetics = "fill")
gnupalette(n)
Arguments
... |
Arguments passed on to
|
na.value |
Colour to use for missing values |
aesthetics |
Character string or vector of character strings listing the
name(s) of the aesthetic(s) that this scale works with. This can be useful, for
example, to apply colour settings to the |
n |
The number of colors to return |
Examples
library(ggplot2)
ggplot(iris, aes(Sepal.Width, Sepal.Length, color = Species)) +
geom_point() +
scale_color_gnuplot() +
scale_x_gnuplot() +
scale_y_gnuplot() +
theme_gnuplot()
gnupalette(3)
gnucolors[1:3]
gnuplot-like (continuous) axes for ggplot2
Description
These functions set up gnuplot-like secondary axes. They also try to choose pretty breaks/ticks for continuous data. Your mileage with the breaks/ticks may vary, so be sure to try different settings.
Usage
scale_x_gnuplot(breaks = gnubreaks(), sec.axis = gnuaxis(), ...)
scale_y_gnuplot(breaks = gnubreaks(), sec.axis = gnuaxis(), ...)
gnubreaks(n = 5, padding = 0.1)
Arguments
breaks |
One of:
|
sec.axis |
|
... |
Other arguments passed on to |
n |
The number of breaks/ticks to return |
padding |
The amount of space between the outermost breaks/ticks and the axis limits relative to the axis range. A number between 0 and 0.5. |
See Also
The labeling package for alternative
break/tick functions, and ggplot2::dup_axis()
,
for which gnuaxis()
is an alias
Examples
library(ggplot2)
ggplot(iris, aes(Sepal.Width, Sepal.Length, color = Species)) +
geom_point() +
scale_color_gnuplot() +
scale_x_gnuplot() +
scale_y_gnuplot() +
theme_gnuplot()
gnuplot theme for ggplot2
Description
This theme makes ggplot2 look like gnuplot.
It is based on ggplot2::theme_linedraw()
and has inward ticks.
Usage
theme_gnuplot(
base_size = 11,
base_family = "",
base_line_size = base_size/22,
base_rect_size = base_size/22
)
Arguments
base_size |
base font size |
base_family |
base font family |
base_line_size |
base size for line elements |
base_rect_size |
base size for rect elements |
See Also
The default ggplot2 themes and ggplot2::theme()
Examples
library(ggplot2)
ggplot(iris, aes(Sepal.Width, Sepal.Length, color = Species)) +
geom_point() +
scale_color_gnuplot() +
scale_x_gnuplot() +
scale_y_gnuplot() +
theme_gnuplot()