s-u / Cairo

R graphics device using cairo graphics library for creating high-quality output
12 stars 10 forks source link

res argument not used for text in grid graphics #7

Closed wch closed 10 years ago

wch commented 10 years ago

The res argument affects font sizes in base graphics, but doesn't seem to affect font sizes in grid graphics.

library(Cairo)
packageVersion('Cairo')
# [1] ‘1.5.3’

# Base graphics
CairoPNG('test-Cairo-72.png', width=250, height=250, res=72)
plot(1:10, 1:10)
dev.off()

CairoPNG('test-Cairo-144-2x.png', width=500, height=500, res=144)
plot(1:10, 1:10)
dev.off()

# Grid graphics (with ggplot2)
library(ggplot2)
Cairo('test-Cairo-ggplot2-72.png', width=250, height=250, res=72)
qplot(1:10, 1:10)
dev.off()

Cairo('test-Cairo-ggplot2-144-2x.png', width=500, height=500, res=144)
qplot(1:10, 1:10)
dev.off()

test-cairo-72 test-cairo-144-2x test-cairo-ggplot2-72 test-cairo-ggplot2-144-2x

wch commented 10 years ago

Excellent, thanks!