Programming statistical graphics

W. J. Braun, D. Murdoch
{"title":"Programming statistical graphics","authors":"W. J. Braun, D. Murdoch","doi":"10.1017/CBO9781316451090.005","DOIUrl":null,"url":null,"abstract":"Users of statistical computing need to produce graphs of their data and the results of their computations. In this chapter we start with a general overview of how this is done in R, and learn how to draw some basic plots. We then discuss some of the issues involved in choosing a style of plot to draw: it is not always an easy choice, and there are plenty of bad examples in the world to lead us astray. Finally, we will go into some detail about how to customize graphs in R. There are several different graphics systems in R. The oldest one is most directly comparable to the original S graphics, and is now known as base graphics. You can think of base graphics as analogous to drawing with ink on paper. You build up a picture by drawing fixed things on it, and once something is drawn, it is permanent, though you might be able to cover it with something else, or move to a clean sheet of paper. Since the very beginning, base graphics has been designed to allow easy production of good quality scientific plots. In this chapter we will concentrate on base graphics. The grid package provides the basis for a newer graphics system. It also has facilities to produce good quality graphics, but the programmer has access to the individual pieces of a graph, and can modify them: a graph is more like a physical model being built and displayed, rather than just drawn. The lattice and ggplot2 packages provide functions for high-level plots based on grid graphics. Both base and grid graphics are designed to be “device independent.” Directions are given regarding where to draw and these drawing commands work on any device. The actual look of a graph will vary slightly from one device to another (e.g. on paper versus in a window on your screen), because of their different capabilities. There are other more exotic graphics systems available in R as well, providing interactive graphics, 3D displays, etc. Some of these will be mentioned briefly in Section 3.4.","PeriodicalId":433866,"journal":{"name":"A First Course in Statistical Programming with R","volume":"26 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2016-07-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"A First Course in Statistical Programming with R","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1017/CBO9781316451090.005","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0

Abstract

Users of statistical computing need to produce graphs of their data and the results of their computations. In this chapter we start with a general overview of how this is done in R, and learn how to draw some basic plots. We then discuss some of the issues involved in choosing a style of plot to draw: it is not always an easy choice, and there are plenty of bad examples in the world to lead us astray. Finally, we will go into some detail about how to customize graphs in R. There are several different graphics systems in R. The oldest one is most directly comparable to the original S graphics, and is now known as base graphics. You can think of base graphics as analogous to drawing with ink on paper. You build up a picture by drawing fixed things on it, and once something is drawn, it is permanent, though you might be able to cover it with something else, or move to a clean sheet of paper. Since the very beginning, base graphics has been designed to allow easy production of good quality scientific plots. In this chapter we will concentrate on base graphics. The grid package provides the basis for a newer graphics system. It also has facilities to produce good quality graphics, but the programmer has access to the individual pieces of a graph, and can modify them: a graph is more like a physical model being built and displayed, rather than just drawn. The lattice and ggplot2 packages provide functions for high-level plots based on grid graphics. Both base and grid graphics are designed to be “device independent.” Directions are given regarding where to draw and these drawing commands work on any device. The actual look of a graph will vary slightly from one device to another (e.g. on paper versus in a window on your screen), because of their different capabilities. There are other more exotic graphics systems available in R as well, providing interactive graphics, 3D displays, etc. Some of these will be mentioned briefly in Section 3.4.
统计图形编程
统计计算的用户需要生成他们的数据和计算结果的图形。在本章中,我们首先概述如何在R中完成这一点,并学习如何绘制一些基本的图。然后,我们讨论了一些与选择情节风格有关的问题:这并不总是一个容易的选择,世界上有很多糟糕的例子会把我们引入歧途。最后,我们将详细介绍如何在r中自定义图形。r中有几种不同的图形系统,最古老的一种与原始的S图形最直接相似,现在被称为基础图形。你可以把基础图形想象成用墨水在纸上作画。你通过在上面画一些固定的东西来建立一幅画,一旦画了一些东西,它就是永久的,尽管你可以用别的东西覆盖它,或者移动到一张干净的纸上。从一开始,基本图形的设计就是为了方便制作高质量的科学图。在本章中,我们将集中讨论基础图形。网格包为新的图形系统提供了基础。它还具有生成高质量图形的功能,但程序员可以访问图形的各个部分,并可以修改它们:图形更像是正在构建和显示的物理模型,而不仅仅是绘制。lattice和ggplot2包提供了基于网格图形的高级绘图功能。基础图形和网格图形都被设计成“与设备无关”。给出了关于在哪里绘制和这些绘制命令在任何设备上工作的指示。由于不同设备的功能不同,图形的实际外观会略有不同(例如,在纸上显示与在屏幕上显示)。R中还有其他更奇特的图形系统,提供交互式图形、3D显示等。其中一些将在3.4节中简要提到。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术官方微信