- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我试图用 geom_hex() 绘制一些对数比例数据,但我在 alpha 透明度设置方面遇到了问题。
剧情脚本;
p <- ggplot(data =test,aes(x=f.log, y=d.log)) +
geom_hex(aes(alpha=log(..count..)),fill="#000000")+
geom_hline(yintercept = 0, size = 0.5,color="red",linetype = 2) +
geom_vline(xintercept = 0, size = 0.5,color="red",linetype = 2) +
theme_bw()
p +scale_y_continuous(labels =(math_format(10^.x)))+
scale_x_continuous(labels =(math_format(10^.x)))
geom_hex(aes(alpha=log..count..),fill="#000000")
geom_hex(aes(alpha=log(..count..)),fill="#000000")
test <- structure(list(
f.log = c(-0.253102353724454, -0.694948028330518,
-0.016322256625567, -0.0748410768849531, -0.306172135262068,
-0.163707542457202, -0.718554577089733, -0.225934877658866, -0.071806377990495,
-0.571575260001342, -0.0366094797226827, -0.576080377580693,
-0.746006267289661, -0.0489249923859604, -0.80387915691451, 0.133518827725897,
1.13432813432443, -0.0728313199164256, 0.088801860213601, -0.0377135174909077,
0.0663337648981581, -0.888283227909353, 0.00578400013079471,
-0.427522775204275, -0.429431853766945, -0.599421888071496, -0.433485730822919,
-0.515019211162214, -0.0938497739399739, -0.0696149165378972,
-0.365920218802188, -1.1263789720313, -0.0782490805177964, -0.564760702549739,
-0.685258621381461, -0.439931899856536, -0.244258110521373, -0.377736080066162,
0.0948218408558909, -0.315931593580799, -0.410836908516327, -0.00322736005782875,
-0.0340076440089306, -0.196481878570063, -0.272522298650196,
1.37978008331572, -0.292128341834852, -0.378338823768808, -0.0549415716234218,
-0.0420760125426677, -0.40022204799827, -0.225078983984126, 0.0892401574558352,
-0.0973233216952992, -0.0829641774248008, 0.0578619031658385,
-0.310146381039605, -0.999501420674584, 0.00793266670295061,
0.0195285261616878, -0.102208121217403, -0.463412962913123, -0.0422559680343639,
-0.152553959237723, 0.0785955919903926, 0.0624471105838305, -0.0123561431773188,
-0.102918934864132, -0.263458888574933, -0.0998643078923408,
-0.022806867299955, -0.0679252575941792, -0.149199322205565,
-0.0700987795333223, 0.507256549482373, 0.494486856445518, -0.356243129746376,
-0.794907813837392, 0.577206234292617, -0.0328657734578033, -0.0339280520132135,
-0.0208144152712735, -0.297619896483973, -0.798019001203047,
-0.59594523782663, -0.00156810067974492, 0.175299530000646, -0.00188269833802159,
0.00329456016770008, -0.0794669187964468, -0.665134080032122,
0.0956185369659824, -0.233759215904792, -0.180983347256778, -0.234613917607553,
-0.143684236915752, -0.361599738783473, -0.784064624768456, -0.186671650665325,
0.149712456026452),
d.log = c(3.16406758837321, 0, 3.80666248977032,
0, 7.74153358928183, 0, 0, 0, 0, 0, 0, 0, 0, 2.07944154167984,
0, 0.693147180559945, 0, 0, 0, 0, 0, 0, 0, -0.441832752279039,
0, 0, 0, 0, -0.0363676441708748, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8.12740456269308,
0, 0, 3.99951045955126, 1.25276296849537, 0, 0, 0, 6.64378973314767,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0.934309237376833,
0, 0, 0, 0, -1.09861228866811, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 4.00733318523247, 0, 0, 0, 7.35179986905778, 0, 0, 0, 1.25276296849537,
2.12026353620009, 0.628608659422374, 0, 4.80402104473326, 0,
0, 0, 0, 0, 0, 0, 0)),
.Names = c("f.log", "d.log"),
row.names = c("oncevatan81",
"hatunkotu", "TwitineGeldim", "Kralice_Hanim", "buguzelmi", "DogrulariYaziyo",
"Cokiyibence", "SevimIiGrup", "Sevimli_Dostu", "gununeniyileri",
"SekerGrup_", "RetweetPrensi", "ReTwitPrensesi", "06uzeyirozdemir",
"RTlerim_Ben2", "tanerunal682", "iyibiIgi", "siz_okursunuz",
"adalet1masall", "SevimliRTcisi", "favlasanaa", "SevimliGrup",
"Peter_Dickerson", "TTPrensi", "MrEgosuz", "iyiyazilar", "KelimePerileri",
"DikkatCekici", "TTPrensesi", "scary_hope", "AcimasizTweets",
"34fuzuli34", "guzelmibu", "yenimesajinvar", "ajans_ag", "KralTweets",
"BayEnteresan", "laftrolog", "ilhanerkek", "BiSevsen_", "erosburc",
"fatihalanresmi", "YuruGunese", "dersemneolurr", "SuskunDuvar",
"FenomenTweet", "eneskadam", "SirinSirine", "SevimliGrup_RT",
"filiz_paker", "KizlaraTavsiyem", "EgoSponsoru", "RTMelankolia",
"scary_TT", "Sevimli_Grup", "canEngul", "TheYabani", "Lafeterya",
"MuckBey", "BizimSadece", "cokcokiyi", "SosluMedya", "TTPrensleri",
"SekerGrup", "adalet1masal", "vebirnot", "Alfred_baba", "KadincaRTler",
"Arajman", "KayaSad", "AKTWEET_", "benrtci", "es_es_rt", "sevdamizzz",
"iyiyazarIar", "iyicumIe", "TarzKadin", "YUCELKAR25", "eniyiyazanlar",
"MazlumunFedaisi", "Ak_Ekip_Rte", "hallendik", "b1rTweet", "newrotik61",
"yeryuzusenin", "ResmiZaytung", "MoRHoPi", "Takipci_TayfA", "emre_izmir_",
"SonDakika_Turk", "Karakterm", "KemalAta34", "MakarnaSos", "mustafabilccan",
"SozMekani", "OrijinalRetweet", "CumlelerdeAsk", "sensinmuptezell",
"AforizmaYazar", "FenaYazar"),
class = "data.frame")
最佳答案
我仍然不确定你想要什么,但我看了指南。我没有看到替代指南值打印方式的方法,类似于您修改轴中值的方式。无论如何,这就是我得到的,使用上面的数据:
p <- ggplot(data =test,aes(x=f.log, y=d.log)) +
geom_hex(aes(fill="#000000",alpha=log(..count..)),fill="#0000ff")+
geom_hline(yintercept = 0, size = 0.5,color="red",linetype = 2) +
geom_vline(xintercept = 0, size = 0.5,color="red",linetype = 2) +
guides(alpha=guide_legend(title="Log of Count",label=T))+
theme_bw() +
scale_y_continuous(labels = (math_format(10 ^ .x))) +
scale_x_continuous(labels = (math_format(10 ^ .x)))
print(p)
关于R ggplot geom_hex alpha 透明度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33558614/
geom_hex几何在 ggplot2根据落入其中的点数为六边形箱着色。这对于均匀分布的数据非常有效,但如果某些区域比其他区域更密集,则效果不佳 - 差异可能会被单个非常密集的六边形的存在所淹没。 如
有谁知道是否可以使用 ggplot 映射到六边形大小?大小在 geom_hex documentation 中被列为参数,但在 stat_hexbin 中没有大小映射的例子,所以这似乎与 bin 大小
我想给 geom_hex 添加标签,这引发了两个问题: 如何获取他们的坐标; 如何提取它们的计数值? 最小的例子: pipeline 0,] ggplot(pipeline,aes(x=Longitu
如果您查看下面的屏幕抓图,您会看到我的 geom_hex 的五行有一个白色边框,使情节看起来很傻。为什么是这样?我该如何阻止它?当我使用 ggsave 保存时,问题变得更糟(更多的白线)! libra
所以我制作了两个六角网格图,我想给颜色填充相同的范围,这样任何给定的颜色在两个图上都意味着相同的东西。但是,要设置范围,我必须在查看两个图后手动输入我看到的上限范围。我希望能够以编程方式获取两个(或更
如果您查看下面的屏幕抓图,您会看到我的 geom_hex 的五行有一个白色边框,使情节看起来很傻。为什么是这样?我该如何阻止它?当我使用 ggsave 保存时,问题变得更糟(更多的白线)! libra
我试图用 geom_hex() 绘制一些对数比例数据,但我在 alpha 透明度设置方面遇到了问题。 剧情脚本; p <- ggplot(data =test,aes(x=f.log, y=d.log
我正在尝试创建一个 hexbin 的交互式图,用户可以在其中单击给定的 hexbin 并接收原始数据框的所有观察结果的列表,这些观察结果分组在该单击的 hexbin 中。 下面是一个 MWE,它似乎非
我想在 R 中制作下面这种类型的图形,它是边缘直方图和我认为的 geom_hex 对象的组合。这最初是一个 matplotlib seaborn 图。 我无法让它与 RColorbrewer 对话。有
我正在尝试用定位数据的六边形热图(stat_binhex + ggmap)覆盖 map 。我可以使用基于正方形的热图(stat_bin2d + ggmap)到达那里,但我认为六边形变体更好。 我得到
我是一名优秀的程序员,十分优秀!