获得R图类型"b".用文字代替点

编程入门 行业动态 更新时间:2024-10-08 11:00:20
本文介绍了获得R图类型"b".用文字代替点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

ggplot2中是否有一种方法可以获取图类型"b"?参见示例:

is there a way in ggplot2 to get the plot type "b"? See example:

x <- c(1:5) y <- x plot(x,y,type="b")

理想情况下,我想用它们的值替换点,使其具有类似于此著名示例的内容:

Ideally, I want to replace the points by their values to have something similar to this famous example:

这里有一些示例数据(我想在绘图类型为"b"的构面中绘制每个猫"):

Here some sample data (I want to plot each "cat" in a facet with plot type "b"):

df <- data.frame(x=rep(1:5,9),y=c(0.02,0.04,0.07,0.09,0.11,0.13,0.16,0.18,0.2,0.22,0.24,0.27,0.29,0.31,0.33,0.36,0.38,0.4,0.42,0.44,0.47,0.49,0.51,0.53,0.56,0.58,0.6,0.62,0.64,0.67,0.69,0.71,0.73,0.76,0.78,0.8,0.82,0.84,0.87,0.89,0.91,0.93,0.96,0.98,1),cat=rep(paste("a",1:9,sep=""),each=5))

关于, 芭蕉叶

推荐答案

gridExtra中有一个实验性的功能,可以在Grid图形中实现,

There's an experimental grob in gridExtra to implement this in Grid graphics,

library(gridExtra) grid.newpage() ; grid.barbed(pch=5)

更多推荐

获得R图类型"b".用文字代替点

本文发布于:2023-07-18 08:07:40,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1142694.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:类型   文字   quot

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!