-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy paththeme_cat.Rd
More file actions
123 lines (95 loc) · 2.69 KB
/
theme_cat.Rd
File metadata and controls
123 lines (95 loc) · 2.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/theme_cat.R
\name{theme_cat}
\alias{theme_cat}
\title{Custom theme for catplot}
\usage{
theme_cat(
base_font_size = 8,
font_family = NULL,
linewidth = 0.5,
panel_widths = NULL,
panel_heights = NULL,
aspect_ratio = NULL,
frame = "open",
show_panel_grid_marjor = "none",
show_panel_grid_minor = "none",
show_title = "both",
show_text = "both",
text_italic = "none",
show_ticks = "both",
ticks_length = 4,
show_legend_title = TRUE,
legend_position = "right",
legend_position_inside = NULL,
legend_direction = NULL,
x_text_angle = 0,
...
)
}
\arguments{
\item{base_font_size}{Numeric, font size (default: 8)}
\item{font_family}{Character, font family (default: NULL)}
\item{linewidth}{Numeric, line width (default: 0.5)}
\item{panel_widths}{Numeric vector, panel widths in pt (default: NULL)}
\item{panel_heights}{Numeric vector, panel heights in pt (default: NULL)}
\item{aspect_ratio}{Numeric, aspect ratio of the plot (default: NULL)}
\item{frame}{Character, frame type, "none","closed" or "open" (default:
"closed")}
\item{show_panel_grid_marjor}{Character, major panel grid visibility
(default: "none")}
\item{show_panel_grid_minor}{Character, minor panel grid visibility
(default: "none")}
\item{show_title}{Character, axis title visibility (default: "both")}
\item{show_text}{Character, axis text visibility (default: "both")}
\item{text_italic}{Character, axis text italicization (default: "none")}
\item{show_ticks}{Character, axis tick visibility (default: "both")}
\item{ticks_length}{Numeric, tick length (default: 4)}
\item{show_legend_title}{Logical, show legend title (default: TRUE)}
\item{legend_position}{Character, position of legend (default: "right")}
\item{legend_position_inside}{Logical, position legend inside the plot
(default: NULL)}
\item{legend_direction}{Character, direction of legend (default: NULL)}
\item{x_text_angle}{Numeric, angle of x-axis text (default: 0)}
\item{...}{Additional arguments}
}
\value{
A ggplot2 theme
A ggplot2 theme
}
\description{
Custom theme for catplot
}
\examples{
library(catplot)
library(ggplot2)
p <- iris |>
ggplot(aes(
x = Sepal.Length,
y = Sepal.Width,
color = Petal.Width,
size = Petal.Width
)) +
geom_point()
p
# Axis title
p + theme_cat(show_title = "y")
# Axis text
p + theme_cat(
text_italic = "x",
show_text = "x"
)
# Axis ticks
p + theme_cat(show_ticks = "y")
# Panel grid
p + theme_cat(show_panel_grid = "both")
# Frame
p + theme_cat(
frame = "closed", aspect_ratio = 1,
show_panel_grid = "both",
show_title = "y"
)
# Panel size
p + theme_cat(panel_widths = 120, panel_heights = 120)
}
\concept{theme}