-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathscratch.R
More file actions
78 lines (70 loc) · 1.64 KB
/
Copy pathscratch.R
File metadata and controls
78 lines (70 loc) · 1.64 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
# ggplot graphics 1
# NJG
# 27 March 2025
#
library(ggplot2)
library(ggthemes)
library(patchwork)
library(extrafont)
font_import() # Imports all system fonts (run once)
# loadfonts(device = "win") # For Windows
fonts()
# Use the font in ggplot
ggplot(data=d) +
aes(x = fl, y = cty,fill=fl)) +
geom_boxplot() +
theme_classic(base_size=30, base_family="Geneva")
ggplot(mtcars, aes(mpg, wt)) +
geom_point() +
labs(x="Fuel efficiency (mpg)", y="Weight (tons)",
title="Seminal ggplot2 scatterplot example",
subtitle="A plot that is only useful for demonstration purposes",
caption="Brought to you by the letter 'g'") +
theme_linedraw(base_size=20)
# theme_linedraw(base_size=25,base_family = "serif")
# built in themes
# theme() xxxx
# theme_grey()
# theme_bw()
# theme_linedraw()
# theme_light()
# theme_dark()
# theme_minimal()
# theme_classic()
# theme_get() xxxx
# theme_replace() xxxx
# theme_set() xxxx
# theme_test() xxxx
# theme_update() xxxx
# theme_void() xxxx
# ggthemes package
# theme_base()
# theme_calc()
# theme_clean()
# theme_economist()
# theme_economist_white()
# theme_excel()
# theme_excel_new()
# theme_few()
# theme_fivethirtyeight()
# theme_foundation()
# theme_gdocs()
# theme_hc()
# theme_igray()
# theme_map()
# theme_pander()
# theme_par()
# theme_solarized()
# theme_solarized_2()
# theme_solid()
# theme_stata()
# theme_tufte()
# theme_wsj()
# hrbrthemes package
# only ipsum and modern themes working
# ggthemr package
# ggtech package
# ggdark package
# Most basic violin chart
ggplot(data=d, aes(x=fl, y=cty, fill=fl)) + # fill=name allow to automatically dedicate a color for each group
geom_violin()