{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# R 绘图基础\n", "\n", "R 的绘图功能一直为业内所津津乐道。\n", "\n", "p.s. *用了 Python 的 matplotlib 和 R 的 ggplot2 后,再也不想用 MATLAB 画图了……*" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "我现在这里先给出本博文用到的包:" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "autoscroll": false }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "Loading required package: lattice\n", "Loading required package: survival\n", "Loading required package: Formula\n", "Loading required package: ggplot2\n", "\n", "Attaching package: 'Hmisc'\n", "\n", "The following objects are masked from 'package:base':\n", "\n", " format.pval, round.POSIXt, trunc.POSIXt, units\n", "\n" ] } ], "source": [ "library(Hmisc)" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "Loading required package: sm\n", "Package 'sm', version 2.2-5.4: type help(sm) for summary information\n" ] } ], "source": [ "library(vioplot)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 基础命令\n", "\n", "使用 `dev.new()` 命令新建一个图片视图,这样你可以输出多个图片到屏幕,而不是让之后输出的覆盖之前的图形。关于 dev.next(), dev.prev(), dev.set() 及 dev.off() 等内容,参考 help(dev.cur). \n", "\n", "### plot() 绘图类型\n", "\n", "基本的绘图类型有以下几种,使用 type= 参数指定:\n", "\n", "- p:仅数据点,默认值。\n", "- l:仅线段\n", "- b:线段与点\n", "- c:仅线段,但点的位置留出空白\n", "- o:线段与点,但线段会延伸到点内部\n", "- h:直方图风格,即带竖直密度线\n", "- s:阶梯图\n", "- S:其他特殊情况\n", "- n;不绘制图形。用于指定标题、坐标轴名称的情况\n", "\n", "### 输出到文件\n", "\n", "将画图的内容输出到文件,可以指定路径,不指定就输出到当前工作目录。例如输出 pdf:\n", "\n", "```r\n", "pdf(\"plot.pdf\")\n", " plot(c(1, 2, 3), c(3, 4, 2))\n", "dev.off()\n", "```\n", "\n", "除了 pdf() 外,其他可用的输出格式对应函数:\n", "\n", "- **wmf**:win.metafile(),仅在 Windows 系统下使用\n", "- **png**: png()\n", "- **jpeg**: jpeg()\n", "- **bmp**: bmp()\n", "- **tiff**: tiff()\n", "- **ps**: postscript()\n", "\n", "例子。详细的参数在下文讨论。" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAA0gAAANICAMAAADKOT/pAAAAMFBMVEUAAABNTU1oaGh8fHyM\njIyampqnp6eysrK9vb3Hx8fQ0NDZ2dnh4eHp6enw8PD////QFLu4AAAACXBIWXMAABJ0AAAS\ndAHeZh94AAAcgUlEQVR4nO3c6UIiyRJA4SyWEhGK93/b1kJsQIGCioiMiDzfjxl77m1zPa2y\ndDkAmK3UngCQASEBAggJEEBIgABCAgQQEiCAkAABhAQIICRAACEBAggJEEBIgABCAgQQEiCA\nkAABhAQIICRAACEBAggJEEBIgABCAgQQEiCAkAABhAQIICRAACEBAggJEEBIgABCAgQQEiCA\nkAABhAQIICRAACEBAggJEEBIgABCAgQQEiCAkAABhAQIICRAACEBAggJEEBIgABCAgQQEiCA\nkAABhAQIICRAACEBAggJEEBIgABCAgQQEiCAkAABhAQIICRAACEBAggJEEBIgABCAgQQEiCA\nkAABhAQIICRAACEBAggJEEBIgABCAgQQEiCAkAABhAQIICRAACEBAggJEEBIgABCAgQQEiCA\nkAABhAQIICRAACEBAggJEEBIgABCAgQQEiCAkAABhAQIICRAACEBAggJEEBIgABCAgQQEiCA\nkAABhAQIICRAgEFIBQjmhVsuH06FIQBJhAQIICRAACEBAggJEEBIgABCAgQQEiCAkAABpiF9\nvK3GJ4FX/YfWEEAVhiENi7MXVCxVhgAqMQypL937bvxov+1KrzEEUIlhSF3Z/Xy8K53GEEAl\nhiFdvED2/qtlCQnB8BUJEGD7M9J2P37Ez0jIxvLh7+XZo3aLQWUIoA7b55H68XmkbvXG80jI\nhVc21PfS+5ThCyHVNlZESt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Kb1Vf\nUryy4fB/Hcd/LzQfk74Yaji+okvha9/67M853VX9GklvUd8vgBvXoH1U10MprurwcytkF1U9\npGF89a3ZUAuNx4nL9fVWW9XfI6ksanxd9PdnVj+qv4ZSWtVVSFKLqhASkA8hAQIICRBASIAA\nQgIEEBIggJAAAYQECCAkQAAhAQIICRBASIAAQgIEEBIggJAAAYQECCAkQAAhAQIICRBASIAA\nQgIEEBIggJAAAYQECCAkQAAhAQIICRBASIAAQgIEEBIggJAAAYQECCAkQAAhAQIICRBASIAA\nQgIEEFJIy/Lx+c+Psq49EXwjpJD2pfv8Z9cNtSeCb4QU06a8Hd7Ke+1p4ISQglqWTVnVngR+\nEFJQ+1LKvvYk8IOQoupLX3sK+I+QguIrki+EFNTq82ekZe1J4AchxfT++Y3dW9nUngZOCCmk\noRufR+KbOzcIKaT19ysb+ObOC0ICBBASIICQAAGEBAggJEAAIQECCAkQQEiAAEICBBASIICQ\nAAGEBAggJEAAIQECCAkQQEiAAEICBBASIICQAAGEBAggJEAAIQECCAkQQEiAAEICBBASIICQ\nAAGEBAggJEAAIQECCAkQ8A+TNERhZVKWTwAAAABJRU5ErkJggg==", "text/plain": [ "plot without title" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "x <- 1:4\n", "y <- c(2, 4, 3, 1)\n", "plot(x, y, type=\"b\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 绘图参数:par()\n", "\n", "函数 par() 用来获取**当前图形**的参数。如果加入 no.readonly=TRUE, 表示该参数列表是非只读的,即用户可以进行修改。例如对于上图,我们获取其参数,进行更改后再传到新的图中(pch 参数可能有些费解,我们在下文讨论):" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAA0gAAANICAMAAADKOT/pAAAAMFBMVEUAAABNTU1oaGh8fHyM\njIyampqnp6eysrK9vb3Hx8fQ0NDZ2dnh4eHp6enw8PD////QFLu4AAAACXBIWXMAABJ0A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E8ImQYtqVl9NLea09DVwQUlDrsiub2pPAF0IK\n6lhKOdaeBL4QUlR96WtPAf8RUlB8RfKFkILavH+PtK49CXwhpJhe3x/YvZRd7WnggpBCGrrx\ndSQe3LlBSCFtP9/ZwIM7LwgJEEBIgABCAgQQEiCAkAABhAQIICRAACEBAggJEEBIgABCAgQQ\nEiCAkAABhAQIICRAACEBAggJEEBIgABCAgQQEiCAkAABhAQIICRAACEBAggJEEBIgABCAgQQ\nEiCAkAABhAQIICRAwD9Y7DwPeF3hXgAAAABJRU5ErkJggg==", "text/plain": [ "plot without title" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# 方法一:类交互式的更改方法\n", "opar <- par(no.readonly=T)\n", "par(pch=17) # 更改点样式\n", "plot(x, y, type=\"b\")\n", "par(opar)\n", "\n", "# 方法二:部分绘图参数支持直接传入参数\n", "# plot(x, y, type=\"b\", pch=17)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 点样式、线宽与线型\n", "\n", "| 参数 | 可选值 |\n", "| --- | --- |\n", "| pch 点样式 | 0空方块,1空圆,2空三角,3加号,4乘号,5斜空方块,6空倒三角,7叉方块,8星号,9斜叉方块,10圈加号,11六芒星,12田,13圈乘号,14加框尖角,15方块,16圆点,17三角,18斜方块,19带边线圆点,20带边线2/3圆点,21填充圆,22填充方块,23填充斜方块,24填充三角,25填充倒三角。 |\n", "| cex 点大小 | 数字,例如 0.5。 |\n", "| lty 线型 | 1实线,2短虚线,3点线,4点划线,5长虚线,6长短划线。 |\n", "| lwd 线宽 | 数字。 |\n", "\n", "*注: pch = 19 相比 pch = 16,主要体现在 lwd 与 cex 不同时,带边线圆点的尺寸较大。*\n", "\n", "### 颜色\n", "\n", "调整颜色的参数有:\n", "\n", "- col: 绘图颜色。\n", "- col.axis:坐标轴刻度颜色。\n", "- col.lab:坐标轴名称颜色。\n", "- col.main:图形标题颜色。\n", "- col.sub:副标题颜色。\n", "- fg:图形前景色。\n", "- bf:图形背景色。\n", "\n", "指定颜色的方式有如下几种:\n", "\n", "+ 数字下标:col=1\n", "+ 名称:col=\"white\"\n", "+ 十六进制值:col=\"#FFFFFF\"\n", "+ 标准化RGB/HSV值:col=rgb(0,1,1)/hsv(0,0,1)\n", "\n", "至于 R 支持的颜色名称,多达 600 余种,这里给出一些我认为常见的:" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAA0gAAANICAMAAADKOT/pAAAAdVBMVEUAAAAAAIsAAP8AZAAA\n/wAA//9NTU1oaGhpaWl8fHyLAACMjIyQ7pCampqgIPClKiqnp6epqamt2OaysrK9vb2+vr7H\nx8fQ0NDT09PZ2dnacNbdoN3h4eHp6enugu7w8PD/AAD/AP//pQD/wMv/1wD//wD////0X81W\nAAAACXBIWXMAABJ0AAASdAHeZh94AAAgAElEQVR4nO3ci5qqyKGG4drJDIQYM2Z02jGjcY7c\n/yVuqopDcerVyF800N/7JLNsD1WAfC2oa5kcwGzmsxcA2ANCAgQICRAgJECAkAABQgIECAkQ\nICRAgJAAAUICBAgJECAkQICQAAFCAgQICRAgJECAkAABQgIECAkQICRAgJAAAUICBAgJECAk\nQICQAAFCAgQICRAgJECAkAABQgIECAkQICRAgJAAAUICBAgJECAkQICQAAFCAgQICRAgJECA\nkAABQorrcUqMOVzd5acpBbc3P7WvH3Iuhjr2ru097nZMjUkOb4NjfHsWvITNGtW1TOdkf7jN\nC+lsH/rtkA7VLMltYBBCioTNGlP9GmQueVnC6yEVrzP3gas7j8tMY+DuhBQJmzWmIp3snj+P\nxqS528d7LxITQhq5Q/vq4vUouTyLQ8pLcf3hw4NgLjZrTFU6fvcd2ol7IT3P9jWlOsN5FqdY\nyenRumvnz9ao96KjR3kxPftL16M9JLx25ute+0jt8Wd7dnwcIcV0OAT7/N3uucX/Wgdc3ZAe\nSXlYluXBTzd3s2n3OBTSyR9EhqpjvUNrvt61qZ2yPTsmIKQF3NwOe6lOXa7BTd2QitKKl4Nn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0vPw+Rv/2zBN9YtM5dZg8948IrsZDU+Xfnts+SzlyOGd9etPgN9\nESGh5VKcM6d7fD3K31+3ZOZJDCEBqBESIEBIgAAhAQKEBAgQEiBASIAAIQEChAQIEBIgQEiA\nACEBAoQECBASIEBIgAAhAQKEBAgQEiBASIAAIQEChAQIEBIgQEiAACEBAoQECBASIEBIgAAh\nAQKEBAgQEiBASIAAIQEChAQIEBIgQEiAACEBAoQECBASIEBIgAAhAQKEBAgQEiBASIAAIQEC\nhAQIEBIgQEiAACEBAoQECBASIEBIgAAhAQKEBAgQEiBASIAAIQEChAQIEBIgQEiAACEBAoQE\nCBASIEBIgAAhAQKEBAgQEiBASIAAIQEChAQIEBIgQEiAACEBAoQECBASIEBIgAAhAQKEBAgQ\nEiBASIAAIQEChAQIEBIgQEiAACEBAoQECBASIEBIgAAhAQKEBAgQEiBASIAAIQEChAQIEBIg\nQEiAACEBAoQECBASIEBIgAAhAQKEBAgQEiBASIAAIQEChAQIEBIgQEiAACEBAoQECBASIEBI\ngAAhAQKEBAgQEiBASIAAIQEChAQIEBIgQEiAACEBAoQECBASIEBIgAAhAQKEBAgQEiBASIAA\nIQEChAQIEBIgQEiAACEBAoQECBASIEBIgAAhAQKEBAgQEiBASIAAIQEChAQIEBIgQEiAACEB\nAoQECBASIEBIgAAhAQKEBAgQEiBASIAAIQEChAQIEBIgQEiAACEBAoQECBASIEBIgAAhAQKE\nBAgQEiBASIAAIQEChAQIEBIgQEiAACEBAoQECBASIEBIgAAhAQKEBAgQEiBASIAAIQEChAQI\nEBIgQEiAACEBAoQECBASIEBIgAAhAQKEBAgQEiBASIAAIQEChAQIEBIgQEiAACEBAoQECBAS\nIEBIgAAhAQKEBAgQEiBASIAAIQEC/w/KlgENvIzHkwAAAABJRU5ErkJggg==", "text/plain": [ "Plot with title \"\"" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "OutputColors <- function(color.names, titleStr=\"\", showText=F) {\n", " plot(1,1, axes=F, xlim=c(0, 6), ylim=c(0, 6), main=titleStr, xlab=\"\", ylab=\"\")\n", " for (i in c(1:5)) {\n", " for (j in c(1:5)) {\n", " par(new=T)\n", " plot(i, 6-j, cex=3, xlim=c(0, 6), ylim=c(0, 6), axes=F,\n", " main=\"\", xlab=\"\", ylab=\"\", pch=19, \n", " col=color.names[(i-1)*5+j])\n", " if (showText) {\n", " text(i, 6-j-0.1, pos=1, color.names[(i-1)*5+j])\n", " }\n", " }\n", " }\n", "}\n", "\n", "colorLst <- c(\"white\", \"red\", \"green\", \"blue\", \"brown\",\n", " \"cyan\", \"gold\", \"gray\", \"plum\", \"magenta\",\n", " \"orange\", \"purple\", \"yellow\", \"black\", \"violet\",\n", " \"darkblue\", \"darkgreen\", \"darkred\", \"darkgray\", \"dimgray\",\n", " \"lightblue\", \"lightgreen\", \"lightgray\", \"orchid\", \"pink\")\n", "OutputColors(colorLst, \"25 Useful Colors\", T)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "R 中还有其他方式可以生成一系列的颜色,比如:" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAA0gAAANICAMAAADKOT/pAAAB41BMVEUAAAAAAP8AJv8AKf8A\nTP8AZv8Ac/8Amf8Ao/8ApgAAv/8A4P8A5f8A/yEA/ykA/00A/2YA/6MA/+AKCgoL/wAQrAAU\nAP8UFBQU/wAfHx8gsQAmAP8pKSkytwAzMzM3/wA9PT1FvQBHR0dMAP9NTU1SAP9SUlJS/wBZ\nwwBcXFxi/wBmZmZoaGhtyQBwcHB6enp8fHyA//+DzgCFhYWK//+MjIyO/wCPAP+Pj4+P/wCV\n//+ZmZmampqa1ACf//+jo6Onp6eq//+tra2ysrKy2gC1//+4uLi6/wC9vb2////CwsLHx8fK\n///L4ADMAP/MzMzM/wDQ0NDU///W1tbZ2dnf///g4ODh4eHm1hLm5gDm/wDnySTovzbpuEjp\n6enqs1rq///rsW3r6+vssn/ttZLuvKXvxbjw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AIpD3\nACACeQ8AIpD3ACACeQ8AIpD3ACACeQ8AIpD3ACACeQ8AIpD3ACACeQ8AIpD3ACACeQ8AIpD3\nACACeQ8AIpD3ACACeQ8AIpD3ACACeQ8AIpD3ACACeQ8AIpD3ACACeQ8AIpD3ACACeQ8AIpD3\nACACeQ8AIpD3ACACeQ8AIpD3ACACeQ8AIpD3ACACeQ8AIvgfstXGLHOugIsAAAAASUVORK5C\nYII=", "text/plain": [ "Plot with title \"\"" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "par(mfrow=c(2 ,3))\n", "OutputColors(rainbow(25), \"Rainbow\")\n", "OutputColors(heat.colors(25), \"HeatMap\")\n", "OutputColors(terrain.colors(25), \"TerrainMap\")\n", "OutputColors(topo.colors(25), \"Topo\")\n", "OutputColors(cm.colors(25), \"CM\")\n", "# 灰度:需要标准化\n", "OutputColors(gray(1/25*c(0:25)), \"Gray\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 标签和标题文本\n", "\n", "从上文可以看出端倪,标签与标题参数有:\n", "\n", "- **标题/副标题**:title/sub\n", "- **坐标轴标题**:xlab/ylab\n", "\n", "在标题中使用上文介绍的参数:\n", "\n", "```r\n", "title(main=\"My Title\", col.main=\"red\",\n", " sub=\"My Subtitle\", col.sub=\"blue\",\n", " xlab=\"My X label\", ylab=\"My Y label\",\n", " col.lab=\"green\", cex.lab=0.75)\n", "```\n", "\n", "要定义它们的字体,可添加的参数有:\n", "\n", "| 参数 | 含义 |\n", "| --- | --- |\n", "| cex | 基础缩放倍数 |\n", "| cex.axis | 坐标轴刻度的缩放倍数 |\n", "| cex.lab | 坐标轴标题的缩放倍数 |\n", "| cex.main | 图形标题的缩放倍数 |\n", "| cex.sub | 图形副标题的缩放倍数 |\n", "| font | 字体样式。1常规,2加粗,3加斜,4加粗加斜,5符号字体 |\n", "| font.axis | 坐标轴刻度的字体样式 |\n", "| font.lab/ main/ sub | 类推 |\n", "| ps | 字体磅值。文字的最终大小为 cex * ps |\n", "| family | 字族。例如 serif衬线, sans无衬线, mono等宽 |\n", "\n", "字族的使用需要注意:Windows 中,等宽映射为 Courier New,衬线 Times New Roman,无衬线 Arial。你可以使用 windowsFonts() 函数来更改或者创建映射,例如我个人常用的 DejaVu 等宽字体:" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAA0gAAANICAMAAADKOT/pAAAAMFBMVEUAAABNTU1oaGh8fHyM\njIyampqnp6eysrK9vb3Hx8fQ0NDZ2dnh4eHp6enw8PD////QFLu4AAAACXBIWXMAABJ0AAAS\ndAHeZh94AAAgAElEQVR4nO3dh1ajQABG4aETQnn/t11mhjKURFf/EIj3O2c1iymoXOnEdAB+\nzbx7BIBPQEiAACEBAoQECBASIEBIgAAhAQKEBAgQEiBASIAAIQEChAQIEBIgQEiAACEBAoQE\nCBASIEBIgAAhAQKEBAgQEiBASIAAIQEChAQIEBIgQEiAACEBAoQECBASIEBIgAAhAQKEBAgQ\nEiBASIAAIQEChAQIEBIgQEiAACEBAoQECBASIEBIgAAhAQKEBAgQEiBASIAAIQEChAQIEBIg\nQEiAACEBAoQECBASIEBIgAAhAQKEBAgQEiBASIAAIQEChAQIEBIgQEiAACEBAoQECBASIEBI\ngAAhAQKEBAgQEiBASIAAIQEChAQIEBIgQEiAACEBAoQECBASIEBIgAAhAQKEBAgQEiBASIAA\nIQEChAQIEBIgQEiAACEBAoQECBASIEBIgAAhAQKEBAgQEiBASIAAIQEChAQIEBIgcEBIBriY\nH0zl+nDe8BKAEiEBAoQECBASIEBIgAAhAQKEBAgQEiBASIDAW0L6cjcwIeFiCAkQODCk/zg2\niZBwMQeGdI8ICZ/qyEW7NjVJ456BRTt8mGPXkW7G3DpCwuc5eGNDk5i0JSR8nMO32hUmqggJ\nn+b4zd91/PXphISEi3nHfqSMkPBpOEQIECAkQOBdIbFDFh/lPCH98tpGwDuxaAcIEBIgQEiA\nACEBAoQECBASIMAZsoDAgSGVhISPdeSiXR0lr34J4D0OXUeqTf7qlwDe4tiNDaWpX/0SwDuw\n1Q4QICRAgJAAAUICBAgJECAkQICQAAFCAgQICRAgJECAkAABQgIECAkQICRAgJAAAUICBAgJ\nECAkQICQAAFCAgQICRAgJECAkAABQgIECAkQICRAgJAAAUICBAgJECAkQICQAAFCAgQICRAg\nJECAkAABQgIECAkQICRAgJAAAUICBAgJECAkQICQAAFCAgQICRAgJECAkAABQgIECAkQICRA\ngJAAAUICBAgJECAkQICQAAFCAgQICRAgJECAkAABQgIECAkQICRAgJAAAUICBAgJECAkQICQ\nAAFCAgQICRAgJECAkAABQgIECAkQICRAgJAAAUICBAgJECAkQICQAAFCAgQICRAgJECAkAAB\nQgIECAkQICRAgJAAAUICBAgJECAkQICQAAFCAgQICRAgJECAkAABQgIECAkQICRAgJAAAUIC\nBAgJECAkQICQAAFCAgQICRAgJECAkAABQgIECAkQICRAgJAAAUICBAgJECAkQICQAAFCAgQI\nCRAgJEDgyJDazJikGp7k6bMQEi7mwJDayFipfxJCwic5MKTclH1NZZS4JyEkfJIDQ4r8A5so\nbggJH+bAkMZ22iQhJHyYA0OKTTveSggJn+XAkEqTDbcakxASPsqRm7/zqZ7KEBI+yqE7ZOt0\nvNVkhIRPwpENgAAhAQKEBAi8KyQ2NuCjnCckE1K8BHAcFu0AAUICBAgJECAkQICQAAFCAgQO\nPR/p21u4CQkXc+hpFISET3Xkol3tL9fwypcA3uPY0yhM/uqXAN7i2I0Npalf/RLAO7DVDhAg\nJECAkAABQgIECAkQICRAgJAAAUICBAgJECAkQICQAAFCAgQICRAgJECAkAABQgIECAkQICRA\ngJAAAUICBAgJECAkQICQAAFCAgQICRAgJECAkAABQgIECAkQICRAgJAAAUICBAgJECAkQICQ\nAAFCAgQICRAgJECAkAABQgIECAkQICRAgJAAAUICBAgJECAkQICQAAFCAgQICRAgJECAkAAB\nQgIECAkQICRAgJAAAUICBAgJECAkQICQAAFCAgQICRAgJECAkAABQgIECAkQICRAgJAAAU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\nIEBIgAAhAQKEBAgQEiBASIAAIV1Wye/uRPhlXFV9preTBL+Mi6ojQjoTfhnXVJqEkM6EX8Y1\nmVzyXtxQ4ZdxTbXmTe2hwi/jsgjpTPhlXBYhnQm/jMsipDPhl3FZhHQm/DIui5DOhF/GZRHS\nmfDLuCxCOhN+GZdFSGfCL+OyCOlM+GUAAoQECBASIEBIgAAhAQKEBAgQEiBASIAAIQEChAQI\nEBIgQEiAACEBAoQECBASIEBIgAAhAQKEBAgQEiBASIAAIQEChAQIEBIgQEiAACEBAoQECBAS\nIEBIgAAhAQKEBAgQEiDwD+ckZPChMuasAAAAAElFTkSuQmCC", "text/plain": [ "plot without title" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "windowsFonts(\n", " M=windowsFont(\"DejaVu Sans Mono\")\n", ")\n", "plot(1, 1, type=\"n\")\n", "# 字体示例\n", "text(1, 1.05, paste(\"DejaVu Sans Mono\\n\", \n", " \"0123456789!@#$%^&*()[]{}:;,.<>'/?`~\",\n", " \"abcdefghijklmnopqrstuvwxyz\",\n", " \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\", \n", " sep=\"\\n\"), pos=1, family=\"M\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "如果你需要将图片输出到 pdf,这个参数也是可以使用的:\n", "\n", "```r\n", "pdf(file=\"filename.pdf\", family=\"M\")\n", "```\n", "\n", "### 图形尺寸与边距\n", "\n", "参数 pin 用于指定图形尺寸(英寸),例如 `pin=c(4, 3)` 表示 4 英寸宽 3 英寸高。\n", "\n", "用 mai()/mar() 依次指定下左上右四个方向的边距,单位分别是英寸与英分。默认是 `mar(c(5, 4, 4, 2)) + 0.1`" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 自定义其他元素\n", "\n", "### 坐标轴\n", "\n", "函数 side() 用于自定义坐标轴:\n", "\n", "```r\n", "axis(side, at=, labels=, pos=, lty=, col=, las=, tck=, ...)\n", "```\n", "\n", "- side: 指定在哪绘制坐标轴:1下2左3上4右\n", "- at:刻度线位置\n", "- labels:刻度线旁的标签,缺省时使用 at 中的值\n", "- pos:坐标轴与另一坐标轴相交位置的值\n", "- lty/col:线型/线与刻度的颜色\n", "- las:标签平行于(=0)或垂直于(=2)坐标轴\n", "- tck:刻度线。负值表示在图形外侧,0表示禁用刻度,1表示全长(即网格线);默认 -0.01\n", "\n", "### 网格线:abline() 与次要刻度\n", "\n", "如果想使用次要刻度,请安装 Hmisc 包。次要刻度的长度将会是主刻度的 `tick.ratio` 倍。\n", "\n", "网格线使用 abline() 命令,并分别用 h/v 指定网格线是竖直还是水平。" ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "slideshow": { "slide_type": "-" } }, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAA0gAAANICAMAAADKOT/pAAAAM1BMVEUAAABNTU1oaGh8fHyL\nAACMjIyampqnp6eysrK9vb3Hx8fQ0NDZ2dnh4eHp6enw8PD///9/roWaAAAACXBIWXMAABJ0\nAAASdAHeZh94AAAZ7ElEQVR4nO3d6VrbyBpFYRkChKQZ7v9qO9gJAeJJ1rZUX+ldP47Sp/tZ\nrkELl+0kHl4BTGZYegBADwgJCCAkIICQgABCAgIICQggJCCAkIAAQgICCAkIICQggJCAAEIC\nAggJCCAkIICQgABCAgIICQggJCCAkIAAQgICCAkIICQggJCAAEICAggJCCAkIICQgABCAgII\nCQggJCCAkIAAQgICCAkIICQggJCAAEICAggJCCAkIICQgABCAgIICQggJCCAkIAAQgICCAkI\nICQggJCAAEICAggJCCAkIICQgABCAgIICQggJCCAkIAAQgICCAkIICQggJCAAEICAggJCCAk\nIICQgABCAgIICQggJCCAkIAAQgICCAkIICQggJCAAEICAggJCCAkIICQgABCAgIICQggJCCA\nkIAAQgICCAkIICQggJCAAEICAggJCCAkIICQgABCAgIICQggJCCAkIAAQgICCAkIICQggJCA\nAEICAswQ0nCIbwf/zWXw8YV8F9zl+XDOfohv4Qfi48v4hMTHF/AJiY8v4CsWEtAmQgICCAkI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2cNwt/Q4jnEX3eCFbpaH4eev//0xfF/m4U/zONy2HNLdbmzNDnEz\nvD1XNju8N35c9DVIB1loqnfD8+vbz9Vmf2QND23fBjsaH+KwWXoEh3kO/6RcaCeGxn+ivj61\nPLg/vAy3Sw/hGA/D49JDOMzt8CykeWh6cFsetwfkRvl1dHpYegyH+T78yG6wkA7S9ODeeN40\nezL+xePdpt2XwNsXFUKah6YH9/r29m3TB7tf3Dd7trt5++Cgh5A2QprMbcufwm15afXdhvvt\nmbiHkHbv2j23+67da+shPd/cPi89hpO0uoTDOzllzDSK79sfCT9bfjna7F2w5Wfbb9jtPkd6\nbvW3rvQTUvu/s6HtkJ7b7mj3Oxte7pp9jbSlh6Pd683250HTd0PLId3Hf6KG2bS/v32E9LL9\n3d8LPfh5tHuXfjibLD2Qg/za35umn486CQnoCiEBAYQEBBASEEBIQAAhAQGEBAQQEhBASEAA\nIQEBhAQEEBIQQEhAACEBAYQEBBASEEBIQAAhAQGEBAQQEhBASEAAIQEBhAQEEBIQQEhAACEB\nAYQEBBASEEBIQAAhAQGEBAQQEhBASEAAIZXj8dOevdwPw/3TUmPBH4RUjafP39i4+7JWJS2N\nkIrxtPkU0vbrwx+Gu8XGgx1CqsXjcPsppM3w8tr290avBDtQi+HhvZoP9QybhYaDPwipFk+v\ne0J6GB6XGg9+I6RyfD3H/Rh+PU1hYYRUjq8hPd5thu/LDAXvCKkce95ZuHe2WxohlWNPSC/e\nbVgaIZVj33vd3v9eGhtQjj2fIz0PN0uNBjuEVI5/f2fDy53XSEsjpHJ8/hxp93vtbpccEF6F\nVJAvH8g+bIYbz0eLIyQggJCAAEICAggJCCAkIICQgABCAgIICQggJCCAkIAAQgICCAkIICQg\ngJCAAEICAggJCCAkIICQgABCAgIICQggJCCAkIAAQgICCAkIICQggJCAAEICAggJCCAkIICQ\ngABCAgL8DzGTYvDut0nOAAAAAElFTkSuQmCC", "text/plain": [ "plot without title" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# 需要加载:library(Hmisc)\n", "plot(1:3, 1:3, type=\"b\", xlim=c(0, 4), ylim=c(0, 4))\n", "minor.tick(nx=2, ny=4, tick.ratio=0.5)\n", "abline(v=seq(0, 4, 0.5), h=seq(0, 4, 0.25), lty=2, col=\"darkred\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 图例\n", "\n", "命令 legend() 用于添加图例。\n", "\n", "```r\n", "legend(location, legend, [title=, ...])\n", "```\n", "\n", "参数含义:\n", "\n", "- location:指定图例左上角的坐标,或者使用以下关键字:\n", " - 关键字:left/right, bottom/top, bottomleft/right, topleft/right, center\n", " - 如果使用了以上关键字,可以使用 inset= 参数指定向图形内移动的比例(分数形式)\n", "- legend:标签组成的字符型向量。 \n", "- title:图例标题的字符串\n", "- 其他参数:\n", " - col/pch/lwd/lty:图例线条颜色/点样式/线宽/线型\n", " - bty/fill:盒型样式/颜色填充(用于条形图、箱形图或饼图)\n", " - bg:背景色\n", " - text.col:文本颜色\n", " - horiz:TRUE 会将图例水平放置\n", "\n", "例子参见“直方图”一节的最后一例。\n", "\n", "### 标注\n", "\n", "#### 文字标注\n", "\n", "主要有两个函数:text() 与 mtext()。前者向绘图区添加标注,后者向图形的边界添加标注。\n", "\n", "```r\n", "text(location, \"string\", pos, ...)\n", "mtext(\"string\", side, line=n, ...)\n", "```\n", "\n", "可以参考“标签和标题文本”一节的例子。其中:\n", "\n", "- pos:使用1下2左3上4右的对应关系,比如“颜色”一节中就使用了 pos=1 的参数。\n", " - 如果指定了 pos,那么也可以指定 offset= 作为偏移量比值(相对单个字符宽)\n", "- side:指定放置文本的图片边界,同样是1下2左3上4右。\n", " - 你可以使用 line= 来移动文本(正值向外,负值向内);\n", " - 还可以通过 adj=0/1 指定文本向左下/右上对齐。\n", "\n", "#### 数学标注\n", "\n", "类似 LaTeX 的标注方式,不过实质上仍有一些区别:\n", "\n", "| 代码 | 效果 | 代码 | 效果 | 代码 | 效果 |\n", "| --- | --- | --- | --- | --- | --- |\n", "| x%+-%y | $x\\pm y$ | x%/%y | $x\\div y$ | x%\\*%y | $x\\times y$ |\n", "| x%.%y | $x\\cdot y$ | x[i] | $x_i$ | x^2 | $x^2$ |\n", "| x%prop%y | $x\\propto y$ | sqrt(x, y) | $\\sqrt[y]{x}$ | x!=y | $x\\neq y$ |\n", "| x%\\~\\~%y | $x\\approx y$ | x%=\\~%y | $x\\cong y$ | x%==%y | $x\\equiv y$ |\n", "\n", "部分字体相关的命令:\n", "\n", "- plain(x):正体\n", "- italic(x):意大利字族(加斜)\n", "- bold(x):加粗\n", "- bolditalic(x):加斜加粗\n", "- underline(x):下划线" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 叠加绘图\n", "\n", "叠加绘图最简单的方法,就是使用绘图的 `new=TRUE`:\n", "\n", "```r\n", "plot( ... )\n", "plot( ... , new=TRUE) # 记得用 axes=FALSE 将坐标轴、标签、标题隐藏掉\n", "```\n", "\n", "如果想要添加额外的点、线,使用 `points()` 命令与 `lines()` 命令。以及上面提到的参考线 `abline()` 命令:" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAA0gAAANICAMAAADKOT/pAAAAOVBMVEUAAAAAAP9NTU1oaGh8\nfHyMjIyampqgIPCnp6eysrK9vb3Hx8fQ0NDZ2dnh4eHp6enw8PD/AAD////fNIaPAAAACXBI\nWXMAABJ0AAASdAHeZh94AAAgAElEQVR4nO3dYWPaNhRGYYVARmlKKP//x65ASIBgsK1X0r26\n5/mwZe1Wy9c5S2QIpD2AbKn1AoAeEBIgQEiAACEBAoQECBASIEBIgAAhAQKEBAgQEiBASIAA\nIQEChAQIEBIgQEiAACEBAoQECBASIEBIgAAhAQKEBAgQEiBASIAAIQEChAQIEBIgQEiAACEB\nAoQECBASIEBIgAAhAQKEBAgQEiBASIAAIQEChAQIEBIgQEiAACEBAoQECBASIEBIgAAhAQKE\nBAgQEiBASIAAIQEChAQIEBIgQEiAACEBAoQECBASI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m7vegrm1zqkX8d96XsydF/n5ivm4YEHO5+o7zf7dmvzu12fsfmdl/P1RVM2v9Yh\nGXtk/uDmAeP1cbP8PvivV/Vxe//L2Px+rM/Y/I7PbNitvvdIbp/ZsP/+RD39/dXa7dHr9e1O\nT86y8j/8tzAhvusAAAHSSURBVPT93DWL8/uxPmPz+3yu3XFc2vk1D2l3fPZt/VUM+7m+VzM3\nb9OPkGzN7/767Mzv+GTvz+Vo52drEwg4RUiAACEBAoQECBASIEBIgAAhAQKEBAgQEiBASIAA\nIQEChAQIEBIgQEiAACEBAoQECBASIEBIgAAhAQKEBAgQEiBASIAAIQEChAQIEBIgQEiAACEB\nAoQECBASIEBIgAAhAQKEBAgQEiBASO5srq7Z7i2lt22rteCMkLzZXr1Z9OebolJSa4TkzHZx\n867rb4e/rJqtByeE5MsmLa9CWqTd/vv9o9EMV8CXtL551/XTh4tGy8EZIfmy3d8JaZ02rdaD\nT4Tkzu33cb/Tvy9TaIyQ3LkNabNapF9tloIvhOTOnTsLb3xv1xohuXMnpB13G1ojJHfu3evm\n/ndrXAB37jyO9JFeW60GJ4Tkzs9nNuxW7JFaIyR3rh9HOj3XbtlyQdgTkkM3D8iuF+mVr0fN\nERIgQEiAACEBAoQECBASIEBIgAAhAQKEBAgQEiBASIAAIQEChAQIEBIgQEiAACEBAoQECBAS\nIEBIgAAhAQKEBAgQEiBASIAAIQEChAQIEBIgQEiAACEBAoQECBASIEBIgAAhAQL/A6dnOmwm\n4PIEAAAAAElFTkSuQmCC", "text/plain": [ "plot without title" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "plot(1:3, c(1,3,2), type=\"b\", pch=2)\n", "\n", "points(1:3, seq(1.5, 2.5, 0.5), col=\"blue\", pch=16)\n", "lines(1:3, seq(1.5, 2.5, 0.5), col=\"red\")\n", "abline(v=1.5, h=2.25, lty=2,col=\"purple\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 子图\n", "\n", "#### 函数 layout()\n", "\n", "函数 layout() 是一个强大的命令。例如:\n", " \n", "```r\n", "layout(matrix(c(1,1,2,3), 2, 2, byrow = TRUE))\n", "```\n", "\n", "就指定了图 1 占用第一行,图 2 和 3 共用第二行。也可以用 widths=/heights= 参数指定各列宽/各行高之间的比例:" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAA0gAAANICAMAAADKOT/pAAAACVBMVEUAAAC+vr7////xRzIL\nAAAACXBIWXMAABJ0AAASdAHeZh94AAAY+UlEQVR4nO3d0WIct5Vo0Q7//6NnEtkSCVBkN7lZ\nDVSt9WAriNn3nEJtW5InvLcX4Ntuzx4AzkBIEBASBIQEASFBQEgQEBIEhAQBIUFASBAQEgSE\nBAEhQUBIEBASBIQEASFBQEgQEBIEhAQBIUFASBAQEgSEBAEhQUBIEBASBIQEASFBQEgQEBIE\nhAQBIUFASBAQEgSEBAEhQUBIEBASBIQEASFBQEgQEBIEhAQBIUFASBAQEgSEBAEhQUBIEBAS\nBIQEASFBQEgQEBIEhAQBIUFASBAQEgSEBAEhQUBIEBASBIQEASFBQEgQEBIEhAQBIUFASBAQ\nEgSEBAEhQUBIEBASBIQEASFB4Ish6Q9eExIEHizi9srPDAQ7ejSH21++TGBv3E7g2c9wLw8/\nrl8P+IMvcwH/7/af7bnHh3zhcf03JSF9TEhX86XHdRPSJ4R0NV97XB/9BNoFvAjpevrH5QJe\nhHQ9QvoRQroaIf0IIV2NkH6EkK5GSD9CSFcjpB8hpKsR0o8Q0tUI6UcI6WqE9COEdDVC+hFC\nuhoh/QghXY2QfoSQrkZIP0JIVyOkHyGkqxHSjxDS1QjpRwjpar76P+z7+9e5gBchXc/D30Xo\n3+/Y8NcvdAEvQrqeR7+v3cvv/535377SBbwI6Xq+ENLLeyHd9f3QnvQN2lJ3PqdnZ/B9QnpI\nFdJdn3id1+s6m/LLF7/T6gffSEhIl9qUXx7/Tqv//Okrv9lwndfrOpvyy6H/Huk6r9d1NuUX\nIT1GSLxLSI8REu8S0mOExLuE9Bgh8S4hPUZIvEtIjxES7xLSY4TEu4T0GCHxLiE9Rki8S0iP\nERLvEtJjhMS7hPQYIfEuIT1GSLxLSI8REu8S0mOExLuE9Bgh8a7H/xey//5vY/1PzT96Ss+e\n8/uE9JCvfM+G26tvgfLQJ17n9brOpvzyle8i9PF3iBTSpTbll6+F9HL72ve1e/bL8X1CGjc9\ngfs2/eQ5fPEvv/kn0ofP6dlzfp9NH+L72j3G63XZTT95Dl/+AiF99JSePef32fQh/j3SY7xe\nl930k+dQfMi9n3idh27TjQjpCbxel930k+dQfMi9n3idh27TjQjpCbxel930k+dQfMi9n3id\nh27TjQjpCbxel930k+dQfMi9n3idh27TjQjpCbxel930k+dQfMi9n3idh27TjQjpCbxel930\nk+dQfMi9n3idh27TjQjpCbxel930k+dQfMi9n3idh27TjQjpCbxel930k+dQfMi9n3idh27T\njQjpCbxel930k+dQfMi9n3idh27TjQjpCbxel930k+fw4F/++TcxEpJN9/Lc7yI0nt/zXcKu\n89BtupEnfxehL/wF13noNt3Ik36N9NlXCMmme/GbDU/g9brspp88h+JD7v3E6zx0m25ESE/g\n9brspp88h+JD7v3E6zx0m25ESE/g9brspp88h+JD7v3E6zx0m25ESE/g9brspp88h+JD7v3E\n6zx0m25ESE/g9brspp88h+JD7v3E6zx0m25ESE/g9brspp88h+JD7v3E6zx0m25ESE/g9brs\npp88h+JD7v3E6zx0m25ESE/g9brspp88h+JD7v3E6zx0m25ESE/g9brspp88h+JD7v3E6zx0\nm27kSd+z4bNvcSIkm+7lud9F6K9fKCSb7uUp39fu868Ukk33slRI931fuxO48zmdgE0f0f8T\nCS6o/zUSXFD/u3ZwQYKAgJAgICQICAkCQoKAkCAgJAgICQJCgoCQICAkCAgJAkKCgJAgICQI\nCAkCQoKAkCAgJAgICQJCgoCQIHCKkObvD3aKtd66wLdBe2/F+Rsp3l5WvN/1Jnrc7dUf3xyd\nyu3Nn07pvRXf/46k6z2F9SZ62G348/jjk3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9h\nfH4nD+nzlyV+NGs/Pz+1+6ZXg/ip3Xt/efZoFn9+tz9/Xjyk93+u/WxXCunBl+VaIb1a99fK\nq4Y0zvnystLv2r19fv/+p5P9rt2DL0v8aJZ/fn9+RXj759/NrPVvPN7+mnXlf4/0+/m99y9L\nFnuqX/TIyxI/mhM8vWV5thfisn/Cq595cw1u+0ec4P/ihoe4bggICQJCgoCQICAkCAgJAkKC\ngJAgICQICAkCQoKAkCAgJAgICQJCgoCQICAkCAgJAkKCgJAgICQICAkCQoKAkCAgJAgICQJC\ngoCQICAkCAgJAkKCgJAgICQICAkCQoKAkCAgJAgICQJCgoCQICAkCAgJAkKCgJAgICQICAkC\nQoKAkCAgJAgICQJCgoCQICAkCAgJAkKCgJAgICQICAkCQoKAkCAgJAgICQL/B3mmoNq3uBKD\nAAAAAElFTkSuQmCC", "text/plain": [ "plot without title" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "tmp <- c(rep(\"Cat\", 3), rep(\"Dog\", 4), rep(\"Rabbit\", 2))\n", "dt <- table(tmp)\n", "\n", "layout(matrix(c(1, 1, 2, 3), 2, 2, byrow = TRUE),\n", " widths=c(3, 1), heights=c(1, 2))\n", "barplot(dt)\n", "barplot(dt)\n", "barplot(dt)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### 函数 par() 的 mfrow 参数\n", "\n", "前文介绍过的 par() 中的 mfrow= 参数也是一个控制子图的方式。下例是两行两列的子图:\n", " \n", "```r\n", "opar <- par(no.readonly=TRUE)\n", "par(mfrow=c(2,2))\n", "plot(...) # 图 1,左上\n", "plot(...) # 图 2,右上\n", "plot(...) # 图 3,左下\n", "plot(...) # 图 4,右下\n", "par(opar)\n", "```\n", "\n", "#### 函数 par() 的 fig 参数\n", "\n", "这种方式支持你以任何的位置、组合任意的图形。它比规整的 layout() 更加灵活。以下不使用 0.8 而使用 0.65 是为了看上去更紧凑。" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAA0gAAANICAMAAADKOT/pAAAAM1BMVEUAAABNTU1oaGh8fHyM\njIyampqnp6eysrK9vb2+vr7Hx8fQ0NDZ2dnh4eHp6enw8PD////ojgWfAAAACXBIWXMAABJ0\nAAASdAHeZh94AAAfSklEQVR4nO2dbVta2w5FN4IoWpX//2uvvNlgPTWupGHN3DE+9NCctmtm\n7zmqKH1Y9gAQZrl1AIAOIBJAAogEkAAiASSASAAJIBJAAogEkAAiASSASAAJIBJAAogEkAAi\nASSASAAJIBJAAogEkAAiASSASAAJIBJAAogEkAAiASSASAAJIBJAAogEkAAiASSASAAJIBJA\nAogEkAAiASSASAAJIBJAAogEkAAiASSASAAJIBJAAogEkAAiASSASAAJIBJAAogEkAAiASSA\nSAAJIBJAAogEkAAiASSASAAJIBJAAogEkAAiASSASAAJIBJAAogEkAAiASSASAAJIBJAAogE\nkAAiASSASAAJIBJAAogEkAAiASSASAAJIBJAAogEkAAiASSASAAJIBJAAogEkAAiASSASAAJ\nIBJAAogEkAAiASSASAAJIBJAAogEkAAiASSASAAJIBJAAogEkAAiASSASAAJIBJAAogEkAAi\nASSASAAJIBJAAogEkAAiASSASAAJIBJAAogEkAAiASSASAAJIBJAAogEkAAiASSASAAJINI3\nLJNx6+sBX8ON+YZlNxXcr0nhxnwDIoEHbsw3IBJ44MZ8AyKBB27MNyASeODGfAMigQduzDcg\nEnjgxnwDIoEHbsw3IBJ44MZ8AyKBB27MNyASeODGfAMigQduzDcgEnjgxnwDIoEHbsw3IBJ4\n4MZ8AyKBB27MNyASeLjNjbn1PzP9zN+i3lqdaxBpUm4k0q37eA0iQRRE2iESxEGkHSJBHETa\nIRLEQaQdIkEcRNohEsRBpB0iQRxE2iESxEGkHSJBHETaIRLEQaQdIkEcRNohEsRBpB0iQRxE\n2iESxEGkHSJBHETaIRLEQaQdIkEcRNq1EenW/874M9mtmRpE2vUR6dbhrkGkglNvfZOvadJO\noaj9QKRdm3YKRe0HIu3atFMoaj8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H0coaH8y8xD6e7wpNx6xv6f8qsr2WFURCpluOLCN42x5fjQCMQqZbz\ny9r4JKkbiFTM4/rwD2dvnQKyQSSABBAJIAFEAkgAkQASQCSABBAJIAFEAkgAkQASQCSABBAJ\nIAFEAkgAkQASQCSABBAJIAFEAkgAkQASQCSABBAJIAFEAkgAkQASQCSABBAJIAFEAkgAkQAS\nQCSABBAJIAFEAkgAkQASQCSABBAJIAFEAkgAkQASQCSABBAJIAFEAkgAkQASQCSABBAJIAFE\nAkgAkQASQCSABBAJIAFEAkgAkQASQCSABBAJIAFEAkgAkQASQCSABBAJIAFEAkgAkQASQCSA\nBBAJIAFEAkgAkQASQCSABBAJIAFEAkgAkQASQCSABBAJIAFEAkgAkQASQCSABBAJIAFEAkgA\nkQASQCSABBAJIAFEAkgAkQASQCSABBAJIAFEAkjgf8zZee+IPAY+AAAAAElFTkSuQmCC", "text/plain": [ "plot without title" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "opar <- par(no.readonly=TRUE)\n", "\n", "par(fig=c(0, 0.8, 0, 0.8)) # 主图:横向范围与纵向范围(左下为原点)\n", "barplot(dt)\n", "\n", "\n", "par(fig=c(0, 0.8, 0.65, 1), new=TRUE) # 上方的图。注意 new 参数\n", "barplot(dt, axes=F)\n", "\n", "par(fig=c(0.65, 1, 0, 0.8), new=TRUE) # 右侧的图\n", "barplot(dt, axes=F, names.arg=\"\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 统计图\n", "\n", "### 条形图:barplot()\n", "\n", "直接上例子。" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAA0gAAANICAMAAADKOT/pAAAANlBMVEUAAAAAAP8A/wBNTU1o\naGh8fHyMjIyampqnp6eysrK9vb3Hx8fQ0NDZ2dnh4eHp6enw8PD////oRfzpAAAACXBIWXMA\nABJ0AAASdAHeZh94AAAgAElEQVR4nO3dbUPiyhIE4JwLKKuu4v//s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+fh+2fX/ENYeQouRn1e5w3CH9+8+/ndPLFdIw\n8GVd3xBSlIw/R7qiGq6Q9sPw8vnZ+SdcdQgpSsbLc3eQvv9s7j9iYhqGkKJkCul++LHf8j1S\nvxBSlIwhvfy+JVrwxTQOf/VRMlbyPmw+j2vep8WG4+u57fDOVbuuIaQomexudj+1u+1w/GDp\n/fyW6W+3n271IaQomb5ue/sH6LSA93d7+oT21Gygo34hJIYxCCExjEEIiWEMQkgMYxBCYhiD\nEBLDGISQGMYghMQwBiEkhjEIITGMQQiJYQxCSAxjEEJiGIMQEsMYhJAYxiCExDAGISSGMQgh\nMYxBCIlhDEJIDGMQQmIYgxASwxiEkBjGIITEMAYhJIYxCCExjEEIiWEMQkgMYxBCYhiDEBLD\nGISQGMYg/wcsAr5ZienifQAAAABJRU5ErkJggg==", "text/plain": [ "Plot with title \"Title of Barplot\"" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "tmp <- c(rep(\"Cat\", 3), rep(\"Dog\", 4), rep(\"Rabbit\", 2))\n", "dt <- table(tmp)\n", "\n", "barplot(dt, main=\"Title of Barplot\", xlab=\"Pets\", ylab=\"Number\",\n", " col=\"green\", border=\"blue\", density=c(5, 15, 25),\n", " names.arg=paste(\"Pet\", 1:3, sep=\" \"))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 饼图:pie()\n", "\n", "并不推荐的统计图类型,因此 R 中的功能也很有限。\n", "\n", "```r\n", "pie(x, labels=, ...)\n", "```" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAA0gAAANICAMAAADKOT/pAAAAPFBMVEUAAAAA5f8A/01MAP9N\nTU1oaGh8fHyMjIyampqnp6eysrK9vb3Hx8fQ0NDZ2dnh4eHp6enw8PD//wD///9TBNo+AAAA\nCXBIWXMAABJ0AAASdAHeZh94AAAgAElEQVR4nO3bjXbiOrJAYc2NgZAOAQ7v/64X/9tgwGWX\nbVVpf2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kQAEhAQoICVBASIACQgIUEBKggJAABYQE\nKCAkQAEhAQoICVBASIACQgIUEBKggJAABYQEKCAkQAEhAQoICVBASIACQgIUEBKggJAABYQE\nKCAkQAEhAQoICVBASIACQgIUEBKggJAABYQEKCAkQAEhAQoICVBASIACQgIUEBKggJAABYQE\nKCAkQAEhAQoICVBASIACQgIUEBKggJAABYQEKCAkQAEhAQoICVBASIACQgIUEBKggJAABYQE\nKCAkQAEhAQoICVBASIACQgIUEBKggJAABYQEKCAkQAEhAQoICVBASIACQgIUEBKggJAABYQE\nKCAkQAEhAQoICUPYJ2wAAAFSSURBVFBASIACQgIUEBKggJAABYQEKCAkQAEhAQoICVBASIAC\nQgIUEBKggJAABYQEKCAkQAEhAQoICVBASIACQgIUEBKggJAABYQEKCAkQAEhAQoICVBASIAC\nQgIUEBKggJAABYQEKCAkQAEhAQoICVBASIACQgIUEBKggJAABYQEKCAkQAEhAQoICVBASIAC\nQgIUEBKggJAABYQEKCAkQAEhAQoICVBASIACQgIUEBKggJAABYQEKCAkQAEhAQoICVBASIAC\nQgIUEBKggJAABYQEKCAkQAEhAQoICVBASIACQgIUEBKggJAABYQEKCAkQAEhAQoICVBASIAC\nQgIUEBKggJAABYQEKCAkQAEhAQoICVBASIACQgIUEBKggJAABYQEKCAkQAEhAQoICVBASIAC\nQgIUEBKggJAABYQEKCAkQAEhAQoICVBASIACQgIU/D+P8d4O54/0rQAAAABJRU5ErkJggg==", "text/plain": [ "Plot with title \"Pie Chart with Percentage\"" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "dt <- 1:4\n", "lbl <- c(\"A\", \"B\", \"C\", \"D\")\n", "pie(dt, labels=paste(lbl, \" \", round(dt/sum(dt)*100), \"%\", sep=\"\"),\n", " col=topo.colors(length(lbl)), main=\"Pie Chart with Percentage\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 直方图:hist() 及核密度曲线\n", "\n", "直方图表示的是一维的数据(连续型)特征,纵轴是其在对应横轴区间内的频数或者频率。\n", "\n", "```r\n", "hist(x, freq=TRUE, breaks=, ...)\n", "```\n", "\n", "其中 freq 参数默认指定纵轴为频数而不是频率,break 用于指定横轴上分组的个数。" ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAA0gAAANICAMAAADKOT/pAAAAPFBMVEUAAAAAAP8A//9NTU1o\naGh8fHyMjIyQ7pCampqgIPCnp6eysrK9vb3Hx8fQ0NDZ2dnh4eHp6enw8PD///8sSN3ZAAAA\nCXBIWXMAABJ0AAASdAHeZh94AAAgAElEQVR4nO3djXqqOrdA4XSjrmpbq3L/97oF/GEqUJiZ\nCQmM8Zzz7XYpEAlvtUrVlUTknZt7AERLCEhEBgGJyCAgERkEJCKDgERkEJCIDAISkUFAIjII\nSEQGAYnIICARGQQkIoOARGQQkIgMAhKRQUAiMghIRAYBicggIBEZBCQig4BEZBCQiAwCEpFB\nQCIyCEhEBgGJyCAgERkEJCKDgERkEJCIDAISkUFAIjIISEQGAYnIICARGQQkIoOARGQQkIgM\nAhKRQUAiMihbSM45+dXzH9p9iu++Cuc++67aavfXFWhM4ebofLhea3e0GaZJ2R4woybptxD/\n9nW9zhhIxz+l0ZiCzVE1QVUHu7H6lu0BM2qSXv5t49yp76qt6mmyGeW6CzVHF3fv22ysvmV7\nwLxN0vCV/rrms/POAcmmUHN0vdfansrLp3MbvwEalu0B0/fT7vK1vX61+2n+RZK4f3P/7/k6\nFdvvl7m7frcFkkmh5ui69K9c//ylM5KJ9UzSubhNzfZtkp7f3v7x93bNV0i7pGYo40LN0W7n\nXtY/f+mMZGI9k3T9+XX9QXfZVg+f/5qk+3zK+dge05qhjAs2R02/1c+8VMr2gHHtbv/Q/O+5\nrH8d3ZRvIOTDhh/niiuan+J9koBkUtA5qp+XSOcJ8GwPmJ5Jqvb457F1pZdlWv/d3ebhB0iB\nCjpH1W9K24CDn1i2B0zPJH01/3Cbp8FJKu4XAilQQefo6qi4BB3+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Hist fig 2\"" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "set.seed(123)\n", "dt <- rnorm(100, mean=0, sd=1)\n", "par(mfrow=c(1,2))\n", "\n", "# 左图:频率直方图,以及轴须图\n", "hist(dt, freq=F, breaks=10, col=\"cyan\", main=\"Hist fig 1\")\n", "rug(jitter(dt)) # 如果有许多相同值,参数 amount=0.01 可将其随机化\n", "lines(density(dt), col=\"purple\", lwd=2)\n", "\n", "# 右图:频数直方图,以及正态密度曲线\n", "h.plot <- hist(dt, breaks=10, col=\"lightgreen\", main=\"Hist fig 2\")\n", "xfit <- seq(min(dt), max(dt), length.out=40)\n", "yfit <- dnorm(xfit, mean=mean(dt), sd=sd(dt))\n", "yfit <- yfit*diff(h.plot$mids[1:2])*length(dt)\n", "lines(xfit, yfit, col=\"blue\", lwd=2)\n", "box()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "轴须图是一种一维的数据呈现,而上面的左图中的密度曲线是一种核密度估计。要比较核密度图,参考 sm 包的 sm.density.compare() 函数。如果只是要绘制,使用 density() 函数辅助即可:" ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAA0gAAANICAMAAADKOT/pAAAAPFBMVEUAAAAAAP9NTU1oaGh8\nfHyMjIyQ7pCampqnp6eysrK9vb2+vr7Hx8fQ0NDZ2dnh4eHp6enw8PD/AAD///+9NxJhAAAA\nCXBIWXMAABJ0AAASdAHeZh94AAAgAElEQVR4nO3diZqiShJA4SzQdpmy1Ov7v+uwiIKCskQm\nEZnnfDO37RLEKvk7E1zK3YhocW7tO0AUQ0AiEghIRAIBiUggIBEJBCQigYBEJBCQiAQCEpFA\nQCISCEhEAgGJSCAgEQkEJCKBgEQkEJCIBAISkUBAIhIISEQCAYlIICARCQQkIoGARCQQkIgE\nAhKRQEAiEghIRAIBiUggIBEJBCQigYBEJBCQiAQCEpFAQCISCEhEAgGJSCAgEQkEJCKBgEQk\nEJ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AYlIICARCQQkIoGARCQQkIgE\nAhKRQEAiEghIRAIBiUggIBEJBCQigYBEJBCQiAQCEpFAQCISCEhEAgGJSCAgEQn0fylaA6h5\nDjNcAAAAAElFTkSuQmCC", "text/plain": [ "Plot with title \"Kernel Denisty\"" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "plot(density(dt), main=\"Kernel Denisty\")\n", "polygon(density(dt), col=\"lightgreen\", border=\"blue\", lwd=2) # 绘制多边形的函数\n", "# 叠加正态曲线\n", "xfit <- seq(min(dt), max(dt), length.out=40)\n", "yfit <- dnorm(xfit, mean=mean(dt), sd=sd(dt))\n", "lines(xfit, yfit, col=\"red\", lwd=2)\n", "legend(\"topright\", lty=c(1,1), col=c(\"blue\", \"red\"),\n", " legend=c(\"Kernel Density\", \"Normality Curve\"))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 箱形图:boxplot() 及小提琴图\n", "\n", "或者叫箱线图、盒须图。它描述了连续变量的五个特征参数:" ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAA0gAAANICAMAAADKOT/pAAAAMFBMVEUAAABNTU1oaGh8fHyM\njIyampqnp6eysrK9vb3Hx8fQ0NDZ2dnh4eHp6enw8PD////QFLu4AAAACXBIWXMAABJ0AAAS\ndAHeZh94AAAccUlEQVR4nO3diXbqyA5A0fKAcQy2//9v22UzmCG3CyIVRjp7rXfDDVOkx2nA\nSXfCCODPwqe/AMACQgIEEBIggJAAAYQECCAkQAAhAQIICRBASIAAQgIEEBIggJAAAYQECCAk\nQAAhAQIICRBASIAAQgIEEBIggJAAAYQECCAkQAAhAQIICRBASIAAQgIEEBIggJAAAYQECCAk\nQAAhAQIICRBASIAAQgIEEBIggJAAAYQECCAkQAAhAQIICRBASIAAQtqQcFa1L1+nqLvz359e\nbifyFeI3hLQh4ap59zrPQzoU/B+ti/1uyCqK8PPGdQ7jbyH99jwFKex3Q84P96EJoXzxOl0R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aehDRKP+75PpIaQnp0jI/tWRWOl6N23fqxfnfE\nbXwW0mE8PnmPdL2bh6N216vGjsvlsJ/gMxIUEdKj5nK8rJu/QbSLL/JiWw/vgKrx15Ca04vD\nw68hPXwf6XyBMsTj5z+X6+MLENKjolifXH6yYf5xhnUsbbH6qYTxMaTpTVKoDusXf6sLn9zc\nxvWqh3L+Ntb8kw109CUICRBASIAAQgIEEBIggJAAAYQECCAkQAAhAQIICRBASIAAQgIEEBIg\ngJAAAYQECCAkQMBGQwK+zBuPcvlwAH8ICRBASIAAQgIEEBIggJAAAYQECCAkQAAhAQIICRBA\nSIAAQgIEEBIggJAAAYQECCAkQAAhAQIICRBASIAAQgIEEBIggJAAAYQECCAkQAAhAQIICRBA\nSIAAQgIEEBIggJAAAYQECCAkQAAhAQIICRBASIAAQgIEEBIggJAAAYQECCAkQAAhAQIICRBA\nSIAAQgIEEBIggJAAAYQECCAkQAAhAQIICRBASIAAQgIEEBIggJAAAYQECCAkQAAhAQIICRBA\nSIAAQgIEEBIggJAAAYQECCAkQAAhAQIICRBASIAAQgIEEBIggJAAAYQECCAkQAAhAQIICRBA\nSIAAQgIEEBIggJAAAYQECCAkQAAhAQIICRBASIAAQgIEEBIggJAAAYQECCAkQAAhAQIICRBA\nSIAAQgIEEBIggJAAAYQECCAkQAAhAQIICRBASIAAQgIEEBIggJAAAYQECCAkQAAhAQIICRBA\nSIAAQgIEEBIggJAAAYQECCAkQAAhAQIICRBASIAAQgIEEBIggJAAAYQECCAkQAAhAQIICRDw\nHxlSqMeWqso/AAAAAElFTkSuQmCC", "text/plain": [ "Plot with title \"Box Plot\"" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "fig <- boxplot(dt, main=\"Box Plot\")\n", "paras <- c(\"Min\", \"25 percentile\", \"Mean\", \"75 percentile\", \"Max\")\n", "text(1.25, fig$stats, paras, pos=4)\n", "text(0.9, fig$out, \"Abnormal Points\", pos=2)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "如果是 dataframe 数据集中的类别型变量 A ,使用如下语句生成并列箱形图:\n", "\n", "```r\n", "boxplot(y~A, data=dataframe)\n", "```\n", "\n", "如果将公式改写成 `y~A*B`,那么会将类别型变量 A 和 B 的各水平两两组合,再生成箱形图。\n", "\n", "其他参数:\n", "\n", "- varwidth=F/T:为 TRUE 时,箱形图的宽度与样本数的算术平方根成正比。\n", "- horizontal=F/T:为 TRUE 时,箱形图被横置。\n", "- notch=F/T:为 TRUE 时,箱形图在绘制时会显示“凹槽”。" ] }, { "cell_type": "code", "execution_count": 17, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAA0gAAANICAMAAADKOT/pAAAAM1BMVEUAAABNTU1oaGh8fHyM\njIyampqnp6epqamysrK9vb3Hx8fQ0NDZ2dnh4eHp6enw8PD///8V4ouMAAAACXBIWXMAABJ0\nAAASdAHeZh94AAAWX0lEQVR4nO3diVYbSbqF0RQCrjFmeP+nvUhiEHa2XWQcYtLea3VZZTuI\n0B98BQh31fIMFFtaHwBmICQIEBIECAkChAQBQoIAIUGAkCBASBAgJAgQEgQICQKEBAFCggAh\nQYCQIEBIECAkCBASBAgJAoQEAUKCACFBgJAgQEgQICQIEBIECAkChAQBQoIAIUGAkCBASBAg\nJAgQEgQICQKEBAFCggAhQYCQIEBIECCkzixv9ndb1q7+/E3pofgnIXVm+XC7Ye3Kz/7aueTv\nZ8adOQtp+fn1tf/5Z8ky4868vds/3S7L1ca1/+VnyTLjzny8278/ur95eXhzf3j4uCzXx5/b\nL8uv02+5u3r5xcf/ueL1g1vFZ3CZTLgz5yHtjj/uX1s4FnS3LD9efnj5cHVz+s3Xx1/bPZ6v\nPV8hpDpMuDNv7/SPN6+vNly/f8l0LOklkvvnn6+RfXw5dXW29tMKIdVhwp05e61h9/Ty9/cv\nD+6enp9+LIeCjp/c7V4+LB0+sTv+5t3Lg/vd6ddOwfy+QkY1mHFnzkK6PoT08oHp9A2l18/m\nDp/cLa8Pn99e2bt//0xvZ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docqTlM5\n/+unaU4/w+me0FedXen+/b9oLaSveFiuVkL6PM3pZzjdE/qqjyu9Wa7u7h//Z0grKy7c+yA+\nBvTx19+mOf0Mp3tCX/Xb5/OfQvr0NdL9nysu3PVy+sNBT6cXFw4PP/762zSnn+F0T+irzkP6\n9fzw6Wuks1ftfh4ePt+dvlBuddbO/FqWu6eXH/aHoP4M6dM0p5/hdE/oqz4+b799ffTr4573\n77/4+nD3OOM7wVZvEzt9Z+j5019/m+b0M5zuCX3VR0gvn9Yv+1/3n/6Bebt7+an378qfvv84\n3zvBZg83Lx+u9z8PD/94seHzNKef4XRP6Bsc/4kLfyOkvzh+d/7peq4/y8K3ENJfvP55sV3r\nc9A/If3N3fEPk7U+BQMQEgQICQKEBAFCggAhQYCQIEBIECAkCBASBAgJAoQEAUKCACFBgJAg\nQEgQICQIEBIECAkChAQBQoIAIUGAkCBASBAgJAgQEgQICQKEBAFCggAhQYCQIEBIECAkCBAS\nBAgJAoQEAUKCACFBgJAgQEgQICQIEBIECAkChAQBQoIAIUGAkCBASBAgJAgQEgQICQKEBAFC\nggAhQYCQIEBIECAkCBASBAgJAoQEAUKCACFBgJAgQEgQICQIEBIECAkChAQBQoIAIUGAkCBA\nSBAgJAgQEgQICQKEBAH/D7oqbFG+RO+fAAAAAElFTkSuQmCC", "text/plain": [ "Plot with title \"Boxplot\"" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "df <- data.frame(x=dt, type=NA)\n", "df <- df[order(df$x),]\n", "df$type <- c(rep(\"Smaller\", 50), rep(\"Larger\",50))\n", "boxplot(x ~ type, data=df, col=\"darkgray\", main=\"Boxplot\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "最后再提一下箱形图与核密度图的一个结合体:小提琴图(violin plot)。这种图的绘制需要 vioplot 包。\n", "\n", "在小提琴图中,核密度曲线被竖直放置,并对称地显示于数据轴的两侧:" ] }, { "cell_type": "code", "execution_count": 18, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KG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4JqGK+45vugVeabxKi\nni6fvvW+h7bMyzIhlXm8XD48/dX7LhoyL8uEVOjLp/++aPel9200Y16WCancX/97uEzzTsm8\nLBNSwtfLh9630Ip5WSakEr9Ob55jnOZBN5pnAmr4ePn+4qDny0PnO2nGvCwTUom/LpfPz//+\n5/EyzavtzMuyyw+972NQTz+O77H3jTRjUpYJqczXTw//ZvR/vW+jHZMCAUKCACFBgJAgQEgQ\nICQIEBIECAkChAQBQoIAIUGAkCBASBAgJAgQEgQICQKEBAFCggAhQYCQIEBIECAkCBASBAgJ\nAoQEAUKCACFBgJAgQEgQICQIEBIECAkChAQBQoIAIUGAkCBASBAgJAgQEgQICQKEBAFCggAh\nQYCQIEBIECAkCBASBAgJAoQEAUKCACFBgJAgQEgQICQIEBIECAkChAQBQoIAIUGAkCBASBAg\nJAgQEgQICQKEBAFCggAhQYCQIEBIECAkCBASBAgJAoQEAUKCACFBgJAgQEgQICQIEBIE/D9r\n9CYAgUqrugAAAABJRU5ErkJggg==", "text/plain": [ "plot without title" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# 需要加载:library(vioplot)\n", "vioplot(df$x[df$type == \"Larger\"], df$x[df$type == \"Smaller\"],\n", " names=c(\"L\", \"S\"), col=\"gold\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 点图\n", "\n", "用于在水平刻度上绘制大量标签。本例选自参考书目同名章节。各参数:\n", "\n", "- groups:选定一个因子,作为分组依据。\n", "- gcolor:各组标签的颜色。" ] }, { "cell_type": "code", "execution_count": 19, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAA0gAAANICAMAAADKOT/pAAAAPFBMVEUAAAAAAP8AZABNTU1o\naGh8fHyMjIyampqnp6eysrK9vb2+vr7Hx8fQ0NDZ2dnh4eHp6enw8PD/AAD///+EMaalAAAA\nCXBIWXMAABJ0AAASdAHeZh94AAAgAElEQVR4nO3di2KjOBJGYeJ0ptMz252O9f7vur4AKt0w\nmMIq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lft3KQDvGvxkzmXtB6dfZIrsKxzvjElUJc4d0SpNepGqSXP23V\nIL34ae+xJUgvUjNI0W+vet4K21aX/PKqpyVIL3KsIB3r3RKkFzrUoZ3oK2z9aelseLHaQXr9\nBl2hj3K8qdRXaG67NfeC1uv/taz3gewLn3PoNzvM08pbU+y9ImCHCBKggCABCggSoIAgAQoI\nEqCAIAEKCBKggCABCggSoIAgAQoIEqCAIAEKCBKggCABCggSoIAgAQoIEqCAIAEKCBKggCAB\nCggSoIAgAQoIEqCAIDWg87dd6T9pN/EdLMmi4qOghL9XA4ZvCxRX5E7blJeliwjSYvy9GiCC\n1EdAXN13aDP+HC43HAcvWBa3ZDt5gD9QA7r+cvZjkOT15uV19oNlYcT8r+mjvPqrAfaIv08D\nJoM0tpHz5LJ4E8g/ChvKNP4+DejiFMmvixjayG+Q6JIghd/0QJAW4+/TgDRI4UJxE54SJTP8\nCRJBWoa/TwPUglQ4RwqaI4u/TwMm9yXZIAVh68IHIUjP4O/TgCRIxe5v55fJjojxA9nrbfIo\nBGkG/j6AAoIEKCBIgAKCBCggSIACggQoIEiAAoIEKCBIgAKCBCggSIACggQoIEiAAoIEKCBI\ngAKCBCggSIACggQoIEiAAoIEKCBIgIL/A69ZpLYaJ5tUAAAAAElFTkSuQmCC", "text/plain": [ "Plot with title \"Gas Mileage for Car Models\n", "grouped by cylinder\"" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# mtcars 是 R 预装的数据集,其 cyl 变量有三个水平\n", "x <- mtcars[order(mtcars$mpg),]\n", "x$cyl <- factor(x$cyl)\n", "x$color[x$cyl==4] <- \"red\"\n", "x$color[x$cyl==6] <- \"blue\"\n", "x$color[x$cyl==8] <- \"darkgreen\"\n", "dotchart(x$mpg,\n", " labels = row.names(x),\n", " cex=.7,\n", " groups = x$cyl,\n", " gcolor = \"black\",\n", " color = x$color,\n", " pch=19,\n", " main = \"Gas Mileage for Car Models\\ngrouped by cylinder\",\n", " xlab = \"Miles Per Gallon\")" ] } ], "metadata": { "kernelspec": { "display_name": "R", "language": "R", "name": "ir" }, "language_info": { "codemirror_mode": "r", "file_extension": ".r", "mimetype": "text/x-r-source", "name": "R", "pygments_lexer": "r", "version": "4.0.0" }, "toc": { "base_numbering": 1, "nav_menu": {}, "number_sections": true, "sideBar": true, "skip_h1_title": false, "title_cell": "Table of Contents", "title_sidebar": "Contents", "toc_cell": false, "toc_position": {}, "toc_section_display": true, "toc_window_display": false } }, "nbformat": 4, "nbformat_minor": 2 }