当前位置:网站首页>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
边栏推荐
- Logical structure and physical structure
- [solved] there is something wrong with the image
- SD_ CMD_ SEND_ SHIFT_ REGISTER
- 【idea】Could not autowire. No beans of xxx type found
- 氢氧化钠是什么?
- iNFTnews | 喝茶送虚拟股票?浅析奈雪的茶“发币”
- The problem of configuring opencv in qt5.13.2 is solved in detail
- Docker installs MySQL and uses Navicat to connect
- C语言数组专题训练
- 全局变量和静态变量的初始化
猜你喜欢
[untitled]
逻辑结构与物理结构
Mipi interface, DVP interface and CSI interface of camera
【软件测试】04 -- 软件测试与软件开发
[software testing] 04 -- software testing and software development
数学分析_笔记_第8章:重积分
DataGrid offline installation of database driver
ROS2——常用命令行(四)
An article was opened to test the real situation of outsourcing companies
Ros2 - function package (VI)
随机推荐
能量守恒和打造能量缺口
Qu'est - ce que l'hydroxyde de sodium?
[node] differences among NPM, yarn and pnpm
Negative number storage and type conversion in programs
An article was opened to test the real situation of outsourcing companies
NPM and package common commands
[software testing] 05 -- principles of software testing
Raspberry pie 4B arm platform aarch64 PIP installation pytorch
MySQL setting trigger problem
Interpretation of the earliest sketches - image translation work sketchygan
现在有html文件,和用vs制作的mvc(连接了数据库),怎么两个相连?
*P++, (*p) + +, * (p++) differences
DataGrid offline installation of database driver
Mid 2022 documentary -- the experience of an ordinary person
1290_FreeRTOS中prvTaskIsTaskSuspended()接口实现分析
纯碱是做什么的?
并发编程 — 死锁排查及处理
Ros2 - node (VII)
Reading literature sorting 20220104
Inftnews | drink tea and send virtual stocks? Analysis of Naixue's tea "coin issuance"