如何更改点状图的形状? [英] How to change shape of dotplot?

查看:54
本文介绍了如何更改点状图的形状?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个具有以下基本结构的数据文件:

I have a data file with this basic structure:

Type Tm
A 1
A 2
A 3
B 3
B 3
C 1
C 1
C 2

我正在使用以下方法制作一个点图:

I'm making a dotplot out of it using:

ggplot(data=df,aes(x = Tm,fill=Type)) +
geom_dotplot(binwidth=1,method="histodot",stackgroups=TRUE)

工作正常.但是,我想知道是否可以从默认圆更改圆点的形状.例如,使A三角形,B正方形并将C保留为默认圆.我尝试了 scale_shape 的各种组合,但没有成功.有时我会收到各种错误消息,有时什么也没发生.这使我得出以下结论:要么我做错了事,要么根本不可能做.是哪一个?

It works fine. However, I wondered if it's possible to change the shapes of the dots from the default circles. For example to make A triangles, B squares and leave C the default circles. I tried various combinations of scale_shape but no success. Sometimes I get various error messages and sometimes nothing happens. This leads me to the conclusion that either I'm doing something wrong, or that it's not even possible. Which one is it?

修改

joran在2013年2月发表的评论说,该评论尚未实施.在过去的一年半中,该领域有什么发展吗?

The comment by joran from Feb 2013 says that it hasn't been implemented yet. Were there any developments in this field in the past year and a half?

推荐答案

不幸的是,对此没有选择,而且听起来没有任何选择的计划.

Unfortunately, there is NO option for this, and it doesn't sound like there are any plans to make an option.

我很震惊.

https://github.com/tidyverse/ggplot2/issues/1111

也许Plotly有一个选择.

Perhaps Plotly has an option.

这篇关于如何更改点状图的形状?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆