#==============================
# 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)的更多相关文章

  1. Axis.Labels.CustomSize

    tChart1.Axes.Bottom.Labels.CustomSize = ; //Changes spacing occupied by the axis labels between the ...

  2. 3D Slicer Hide 3D Cube and Axis Labels Programmatically 使用代码隐藏三维视图中的方框和坐标轴标签

    在3D Slicer中,我们如果想在自己写的插件中来修改三维视图中的默认设置的话,那么首先就需要获得三维视图的结点,其类型为vtkMRMLViewNode,获得了这个结点后,我们就可以用代码来修改一系 ...

  3. Flot Reference flot参考文档

    Consider a call to the plot function:下面是对绘图函数plot的调用: var plot = $.plot(placeholder, data, options) ...

  4. matplotlib常用操作2

    关于matplotlib学习还是强烈建议常去官方http://matplotlib.org/contents.html里查一查各种用法和toturial等. 下面是jupyter notebook代码 ...

  5. [Python] Statistical analysis of time series

    Global Statistics: Common seen methods as such 1. Mean 2. Median 3. Standard deviation:  the larger ...

  6. ggplot2包--R可视化

    1.ggplot2发展历程 ggplot2是Hadley在爱荷华州立大学博士期间的作品,也是他博士论文的主题之一,实际上ggplot2还有个前身ggplot,但后来废弃了,某种程度上这也是Hadley ...

  7. R:ggplot2数据可视化——进阶(3)

    Part 3: Top 50 ggplot2 Visualizations - The Master List, 结合进阶1.2内容构建图形 有效的图形是: 不扭曲事实 传递正确的信息 简洁优雅 美观 ...

  8. R:ggplot2数据可视化——进阶(2)

    Part 2: Customizing the Look and Feel, 更高级的自定义化,比如说操作图例.注记.多图布局等  # Setup options(scipen=999) librar ...

  9. 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 ...

随机推荐

  1. MySQL 5.6学习笔记(查询数据、插入、更新、删除数据)

    1. 查询语法 SELECT {*|<字段列表>} [FROM table_references [WHERE where_condition] [GROUP BY {col_name | ...

  2. Android Shell命令dumpsys

    dumpsys命令可以显示手机中所有应用程序的信息,并且也会给出现在手机的状态. 直接执行adb shell dumpsys KEY 会显示以下所有信息. KEY的可选名称 SurfaceFlinge ...

  3. Python运维自动化开发之Fabric模块

    本章讲解fabric模块,与上一章的paramiko模块功能类似,fabric是在paramiko基础上又做了一层封装,操作起来更方便.主要用于多台服务器批量执行任务. 非内置Python模块,需要手 ...

  4. Flink安装、高可用性

    Flink JobManager HA模式部署(基于Standalone) SCP 命令 SSH免密码登录,搭建Flink standalone集群 https://blog.csdn.net/jie ...

  5. ie6遮罩层兼容 100%高度的实现

    .black { position:absolute;width:100%;height:100%;opacity:0.5;filter:alpha(opacity=50);background:#0 ...

  6. java中的动态加载和热替换

    https://blog.csdn.net/u010833547/article/details/54312052 ****************************************** ...

  7. 查看SQL实际内存占用

    如果打开了AWE,在任务管理器中就看不到实际的内存使用了.可以用SQL语句来查内存占用,或是“性能监视器(Performance Monitor)中的SQLServer: Memory Manager ...

  8. js判断浏览器内核和版本(包括手机端设备)

    var X, xue;xue = xue || function(expr, fn) {    return xue.dom ? xue.dom(expr, fn) : {};};X = xue;wi ...

  9. JAVA-JSP内置对象之response对象实现页面自动刷新

    相关资料:<21天学通Java Web开发> response对象 实现页面自动刷新1.可以通过response对象的addIntHeader()方法添加一个标题为Refrsh的标头,并指 ...

  10. 3. 集成学习(Ensemble Learning)随机森林(Random Forest)

    1. 集成学习(Ensemble Learning)原理 2. 集成学习(Ensemble Learning)Bagging 3. 集成学习(Ensemble Learning)随机森林(Random ...