Reputation: 1742
For some unfortunate technical reasons, I need to have a pixel plot. For example, let's take this simple plot:
plot(0,0)
Points(x=1:10, y=rep(0,10), cex=1)
I need each dot to be exactly a pixel wide. The size parameter cex does not seem to allow such precision.
Upvotes: 0
Views: 479
Reputation: 999
You could use ggplot
with the option geom_point(shape = ".")
.
For example
# 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()
This will create something like:
Upvotes: 1