当前位置:网站首页>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
边栏推荐
猜你喜欢
iNFTnews | 喝茶送虚拟股票?浅析奈雪的茶“发币”
Mathematical analysis_ Notes_ Chapter 8: multiple integral
Brief description of inux camera (Mipi interface)
PHY drive commissioning - phy controller drive (II)
Special training of C language array
程序中的负数存储及类型转换
The problem of configuring opencv in qt5.13.2 is solved in detail
Ros2 - Service Service (IX)
[software testing] 03 -- overview of software testing
ROS2——ROS2对比ROS1(二)
随机推荐
Ret2xx---- common CTF template proposition in PWN
数学分析_笔记_第8章:重积分
Use of Pai platform
基于FPGA的一维卷积神经网络CNN的实现(八)激活层实现
ModuleNotFoundError: No module named ‘picamera‘
[framework] multi learner
Tshydro tool
你心目中的数据分析 Top 1 选 Pandas 还是选 SQL?
三体目标管理笔记
Negative number storage and type conversion in programs
[vscode] recommended plug-ins
mingling
Inftnews | drink tea and send virtual stocks? Analysis of Naixue's tea "coin issuance"
*P++, (*p) + +, * (p++) differences
Database SQL practice 4. Find the last of employees in all assigned departments_ Name and first_ name
Ethtool principle introduction and troubleshooting ideas for network card packet loss (with ethtool source code download)
M2dgr slam data set of multi-source and multi scene ground robot
逻辑结构与物理结构
NPM and package common commands
Logical structure and physical structure