ggplot2 subscript in x-axis labels(ticks, legend)
#==============================
# ggplot2: subscript in x-axis labels(ticks)
rm(list=ls(all=TRUE))
library(ggplot2)
data <- data.frame(names=tolower(LETTERS[1:4]),mean_p=runif(4))
p <- ggplot(data,aes(x=names,y=mean_p))
p <- p + geom_bar(colour="black",fill="white")
p <- p + xlab("expressions") + scale_y_continuous(expression(paste("Wacky Data")))
p <- p + scale_x_discrete(labels=c(a=expression(paste(Delta^2)),
b=expression(paste(q^n)),
c=expression(log(z)),
d=expression(paste(omega / (x + 13)^2))))
p
# from: http://stackoverflow.com/questions/6202667/how-to-use-subscripts-in-ggplot2-legends-r
#==============================
# ggplot2: subscript in y-axis labels
rm(list=ls(all=TRUE))
library(ggplot2)
dat <- data.frame(x = rnorm(100), y = rnorm(100))
ggplot(dat, aes(x=x,y=y)) +
geom_point() +
labs(y=expression(Blah[1*d]))
ggplot(dat, aes(x=x,y=y)) +
geom_point() +
labs(y=expression(Blah["1d"]))
ggplot(dat, aes(x=x,y=y)) +
geom_point() +
labs(y=expression(Blah[1*d]*"%"))
# from: http://stackoverflow.com/questions/17334759/subscript-letters-in-ggplot-axis-label
# http://stackoverflow.com/questions/8514478/subscripts-in-xlabels-in-ggplot2
# http://stackoverflow.com/questions/15125628/putting-mathematical-symbols-and-subscripts-mixed-with-regular-letters-in-r-ggpl
# http://www.janeshdevkota.com/blog/using-superscripts-and-subscripts-in-ggplot2/
ggplot2 subscript in x-axis labels(ticks, legend)的更多相关文章
- Axis.Labels.CustomSize
tChart1.Axes.Bottom.Labels.CustomSize = ; //Changes spacing occupied by the axis labels between the ...
- 3D Slicer Hide 3D Cube and Axis Labels Programmatically 使用代码隐藏三维视图中的方框和坐标轴标签
在3D Slicer中,我们如果想在自己写的插件中来修改三维视图中的默认设置的话,那么首先就需要获得三维视图的结点,其类型为vtkMRMLViewNode,获得了这个结点后,我们就可以用代码来修改一系 ...
- Flot Reference flot参考文档
Consider a call to the plot function:下面是对绘图函数plot的调用: var plot = $.plot(placeholder, data, options) ...
- matplotlib常用操作2
关于matplotlib学习还是强烈建议常去官方http://matplotlib.org/contents.html里查一查各种用法和toturial等. 下面是jupyter notebook代码 ...
- [Python] Statistical analysis of time series
Global Statistics: Common seen methods as such 1. Mean 2. Median 3. Standard deviation: the larger ...
- ggplot2包--R可视化
1.ggplot2发展历程 ggplot2是Hadley在爱荷华州立大学博士期间的作品,也是他博士论文的主题之一,实际上ggplot2还有个前身ggplot,但后来废弃了,某种程度上这也是Hadley ...
- R:ggplot2数据可视化——进阶(3)
Part 3: Top 50 ggplot2 Visualizations - The Master List, 结合进阶1.2内容构建图形 有效的图形是: 不扭曲事实 传递正确的信息 简洁优雅 美观 ...
- R:ggplot2数据可视化——进阶(2)
Part 2: Customizing the Look and Feel, 更高级的自定义化,比如说操作图例.注记.多图布局等 # Setup options(scipen=999) librar ...
- Notes for GGplot2: Getting started with ggplot2
Alpha-ma 2016/10/7 1 Introduction of GGplot2 ggplot2 is an R package for producing statistical, or d ...
随机推荐
- js获取IP地址方法总结
js代码获取IP地址的方法,如何在js中取得客户端的IP地址.原文地址:js获取IP地址的三种方法 http://www.jbxue.com/article/11338.html 1,js取得IP地址 ...
- 腾讯云服务器 安装fastdfs文件服务器
上篇安装完nginx后,那么这次咱们就来安装fastdfs文件服务器,为何要使用文件服务器,这里不多说了,以前的文章有写过 首先用ftp工具把fastdfs的相关文件上传至腾讯云,如下 首先,安装基本 ...
- [svc]ssh批量分发key/批量用户管理
centos6 sshpass批量分发key yum install sshpass -y ssh-keygen -t dsa -f ~/.ssh/id_dsa -P "" 命令说 ...
- View:Android View的scrollTo(),scrollBy(),getScrollX(), getScrollY()的理解
Android系统手机屏幕的左上角为坐标系,同时y轴方向与笛卡尔坐标系的y轴方向想反.提供了 getLeft(), getTop(), getBottom(), getRight() 这些API来获取 ...
- How do I measure JVM startup time?
https://stackoverflow.com/questions/39321345/how-do-i-measure-jvm-startup-time PrintCompilation2 htt ...
- 构造函数 (C++)
构造函数是一种可初始化其类的实例的成员函数. 构造函数具有与类相同的名称,没有返回值. 构造函数可以具有任意数量的参数,类可以具有任意数量的重载构造函数. 构造函数可以具有任何可访问性(公共.受保护或 ...
- python--笨方法学python 习题52
笨方法学python是一本不错的python入门书籍.书的最后一节是一个web版的游戏程序,以下是程序代码: 1.项目的目录结构如下所示:skeleton\ app.py map.py templat ...
- (装机)关于WINRE/ESP/LRS_ESP/MSR/PBR这些分区
WINRE 1GB 用途:Windows 8 系统恢复模式.这个分区是保存是在Windows 8 系统主体本身被破坏无法正常启动的时候进行系统修复的Windows 8 PE系统.. ESP 260MB ...
- hive一行变多行及多行变一行
hive一行变多行及多行变一行 场景 name alias zhaoqiansun abc def ghi 处理数据时需要将上表处理成为下面的形式: name alias zhaoqiansun ab ...
- Android下基于SDL的位图渲染(一)
环境准备 安装Android开发环境(java.android-sdk.android ndk.gcc). 我使用的ndk版本是r10b/r10d,在win10/ubutu 15.04编译 下载sdl ...