ggplot2: how to check the color and coreponding value pairs
The way to check the color and coreponding value pairs in ggplot2
To see what colors are used to make your plot you can use function ggplot_build() and then look at data part of this object (in column colour are codes).
p <- ggplot(df, aes(x = value, y = value, color = type)) +
geom_point(shape = 21, size = 4) ggplot_build(p)$data
# [[1]]
# colour x y PANEL group
# 1 #F8766D 1 1 1 1
# 2 #B79F00 2 2 1 2
# 3 #00BA38 3 3 1 3
# 4 #00BFC4 4 4 1 4
# 5 #619CFF 5 5 1 5
# 6 #F564E3 6 6 1 6
ggplot2 position parameter usage :
ggplot(data = diamonds + geom_bar(mapping = aes(x = cut, fill = clarity),
position = "identity",alpha = 1/5) +
geom_bar(aes(x = cut, fill = clarity), position = "dodge")


ggplot2: how to check the color and coreponding value pairs的更多相关文章
- [R可视化]ggplot2库介绍及其实例
前言 ggplot是一个拥有一套完备语法且容易上手的绘图系统,在Python和R中都能引入并使用,在数据分析可视化领域拥有极为广泛的应用.本篇从R的角度介绍如何使用ggplot2包,首先给几个我觉得最 ...
- [CareerCup] 17.2 Tic Tac Toe 井字棋游戏
17.2 Design an algorithm to figure out if someone has won a game oftic-tac-toe. 这道题让我们判断玩家是否能赢井字棋游戏, ...
- shell example01
条件判断 if [[ -e ${1} ]]; then echo "$(tput setaf 2) found ${1} $(tput sgr0)" cat ${1} else e ...
- Designing for iOS: Graphics & Performance
http://robots.thoughtbot.com/designing-for-ios-graphics-performance [原文] In the previous article, w ...
- 扩展jquery的选择器
I’m sure you all know that it’s possible to create plugins and extend various aspects of the jQuery ...
- Yii2 捕获错误日志
在技术开发中,捕获程序框架错误,是非常必要的一件事情,我们公司使用Yii2框架,简单说下Yii2的错误捕获处理 Yii2 web应用 1 配置如下 其中errorHandler就是错误处理配置,执行E ...
- js正则表达式进行格式校验
今天做了个js正则表达式的练习,利用正则表达式进行注册信息格式验证,注册信息界面如下: 格式要求: 1.学号项不能为空,必须为纯数字,不能与数据库中的重复,正则表达式/^\d+$/g: 2.姓名项不能 ...
- php随机验证码
今天同学问我,用php怎么写验证码,由于是新手所以花了半天的时间才完成.而且功能很是简单呵呵.今天本来打算写session和cookie的看来是要明天了. <?php $image_width= ...
- [Angular 2] @Input & @Output Event with ref
The application is simple, to build a color picker: When click the rect box, it will check the color ...
随机推荐
- 第二章 Session会话管理
采用网址重写的缺点: 在有些Web浏览器中,URL限制为2000个字符. 仅当有链接要插入值时,值才能转换成后面的资源.此外,要把值添加到静态页面的链接中,可不是一件容易的事情. 网址重写必须在服务器 ...
- python爬虫笔记之re.match匹配,与search、findall区别
为什么re.match匹配不到?re.match匹配规则怎样?(捕一下seo) re.match(pattern, string[, flags]) pattern为匹配规则,即输入正则表达式. st ...
- E-R图怎么绘制
E-R图中主要涉及到的元素有: 实体:用长方形表示 关联关系:用菱形表示 属性:用椭圆表示 参考一个例子:
- laravel 5.6初学笔记
laravel 5.6初学笔记 http://note.youdao.com/noteshare?id=bf4b701b49dd035564e7145ba2d978b4 框架简介 laravel文档齐 ...
- mysql8.0的连接写法
由于mysql8.0的新特新,所以Driver要写成“com.mysql.cj.jdbc.Driver” url:"jdbc:mysql://host_address:3306/db_nam ...
- C# StackTrace
StackTrace trace = new StackTrace(); //获取是哪个类来调用的 Type type = trace.GetFrame().GetMethod().Declaring ...
- React入门理解demo
1.React文档结构 <!DOCTYPE html> <html lang="en"> <head> <meta charset=&qu ...
- IDEA自学
使用Eclipse很长时间了,想换个IDE用,都说IDEA好用,今天试试 百度了一下IDEA,了解到IDEA社区版免费,上百度,下载个社区版(exe,zip两种)懒人选择exe 手动安装别怕安错,只管 ...
- 从原理层面掌握HandlerMethod、InvocableHandlerMethod、ServletInvocableHandlerMethod的使用【一起学Spring MVC】
每篇一句 想当火影的人没有近道可寻,当上火影的人同样无路可退 前言 HandlerMethod它作为Spring MVC的非公开API,可能绝大多数小伙伴都对它比较陌生,但我相信你对它又不是那么的生疏 ...
- 用多线程优化Excel表格数据导入校验的接口
公司的需求,当前某个Excel导入功能,流程是:读取Excel数据,传入后台校验每一条数据,判断是否符合导入要求,返回给前端,导入预览展示.(前端等待响应,难点).用户再点击导入按钮,进行异步导入(前 ...