当前位置:网站首页>Ggplot2 drawing learning notes in R
Ggplot2 drawing learning notes in R
2022-07-05 07:15:00 【RS&Hydrology】
Main records of this paper R In language ggplot2 Drawing package drawing image learning notes .
1.ggplot2 Introduce
ggplot2 The core idea of is to separate drawing and data , Data related plots are separated from data independent plots , Is to draw by layer .
ggplot2 The elements of the diagram can be summarized as follows :
The biggest thing is plot( Refers to the whole picture , Include background and title), The second is axis( Include stick,text,title and stick)、legend( Include backgroud、text、title)、facet This is the second level , among facet It can be divided into external strip part ( Include backgroud and text) And internal panel part ( Include backgroud、boder And gridlines grid, The rough one is grid.major, Thin call grid.minor).
2.ggplot2 Data set and plotting
(1) install ggplot2:Install.packages(“ggplot2”)
(2) call ggplot2:library(“ggplot2”)
(3) Load your own dataset :data("iris")
(4) The plot :
IrisPlot <- ggplot2(iris, aes(Sepal.Length, Petal.Length, colour=Species))
+ geom_point()
print(IrisPlot)
understand :
- The data is iris;
- Graph attribute mapping :Sepal.Length Corresponding x Axis ,Petal.Length Corresponding y Axis ;
- Geometry object : Scatter plot ;
- The plus sign is used to add layer information ;
- Data and attribute information are contained in ggplot2 Inside .
Reference material :
Book recommendation :https://ggplot2-book.org/getting-started.html
an instruction manual :https://www.tutorialspoint.com/ggplot2/ggplot2_quick_guide.htm
边栏推荐
- Ethtool principle introduction and troubleshooting ideas for network card packet loss (with ethtool source code download)
- Unity ugui how to match and transform coordinates between different UI panels or uis
- 1290_FreeRTOS中prvTaskIsTaskSuspended()接口实现分析
- Raspberry pie 4B arm platform aarch64 PIP installation pytorch
- D2L installation
- ModuleNotFoundError: No module named ‘picamera‘
- SD_ CMD_ SEND_ SHIFT_ REGISTER
- Initialization of global and static variables
- The difference between new and malloc
- 第 2 章:小试牛刀,实现一个简单的Bean容器
猜你喜欢
随机推荐
Use of Pai platform
能量守恒和打造能量缺口
Tshydro tool
SOC_ SD_ DATA_ FSM
Brief description of inux camera (Mipi interface)
【软件测试】02 -- 软件缺陷管理
The difference between NPM install -g/-save/-save-dev
IPage can display data normally, but total is always equal to 0
Import CV2, prompt importerror: libcblas so. 3: cannot open shared object file: No such file or directory
SOC_SD_DATA_FSM
Solve tensorfow GPU modulenotfounderror: no module named 'tensorflow_ core. estimator‘
全局变量和静态变量的初始化
[node] NVM version management tool
[idea] efficient plug-in save actions to improve your work efficiency
Course learning accumulation ppt
In C language, int a= 'R'
The difference between new and malloc
Energy conservation and creating energy gap
An article was opened to test the real situation of outsourcing companies
2022年中纪实 -- 一个普通人的经历