Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/69.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用R逐像素打印_R_Ggplot2 - Fatal编程技术网

使用R逐像素打印

使用R逐像素打印,r,ggplot2,R,Ggplot2,由于一些不幸的技术原因,我需要一个像素图。 例如,让我们以这个简单的图为例: plot(0,0) Points(x=1:10, y=rep(0,10), cex=1) 我需要每个点都是一个像素宽。大小参数cex似乎不允许这样的精度。您可以使用ggplot选项geom_point(shape=“.”) 比如说 # generate random dataframe df <- data.frame(x = runif(100), y = runif(100)) # make the f

由于一些不幸的技术原因,我需要一个像素图。 例如,让我们以这个简单的图为例:

plot(0,0)
Points(x=1:10, y=rep(0,10), cex=1)

我需要每个点都是一个像素宽。大小参数cex似乎不允许这样的精度。

您可以使用
ggplot
选项
geom_point(shape=“.”)

比如说

# generate random dataframe
df <- data.frame(x = runif(100), y = runif(100)) 

# make the figure
ggplot(df) + aes(x = x, y = y) + geom_point(shape = ".") + theme_void()
#生成随机数据帧
df