+ opts(panel.grid.major = theme_blank(), panel.grid.minor =
theme_blank(), panel.background = theme_blank())
> have the points plotted in
> a bounding box of c(4.457187652587891, 4.543018341064453) and c
> (51.888464736976516, 51.92023802576216),
+ xlim(4.457187652587891, 4.543018341064453)
+ ylim(51.888464736976516, 51.92023802576216)
> with no margins
no_margins <- opts(
axis.line = theme_blank(),
axis.text.x = theme_blank(),
axis.text.y = theme_blank(),
axis.ticks = theme_blank(),
axis.title.x = theme_blank(),
axis.title.y = theme_blank(),
axis.ticks.length = unit(0, "cm"),
axis.ticks.margin = unit(0, "cm"),
panel.background = theme_blank(),
panel.border = theme_blank(),
panel.grid.major = theme_blank(),
panel.grid.minor = theme_blank(),
plot.background = theme_blank(),
plot.title = theme_blank(),
plot.margin = unit(c(0, 0, 0, 0), "lines")
)
+ no_margins
> and of size
> 500 x 300. Could you provide me with tips on how to achieve this?
png("myfile.png", width = 500, height = 300)
print(myplot)
dev.off()
Regards,
Hadley
> myplot <- qplot(x, y, data = ai, xlim(4.457187652587891,
> 4.543018341064453), ylim(51.888464736976516, 51.92023802576216)) +
> opts
it is either:
qplot(blah blah, xlim=c(...), ylim=c(...))
or
qplot(blah blah) + xlim(...) + ylim(...)
xlim and ylim in the second case are just shorthands for
scale_x_continuous(limits=c(...)) and scale_y_cont...
So overall it should be something like:
myplot <- qplot(x, y, data = ai) +
xlim(4.457187652587891, 4.543018341064453) +
ylim(51.888464736976516, 51.92023802576216)) +
opts(panel.grid.major = theme_blank(),
panel.grid.minor = theme_blank(),
panel.background = theme_blank()) +
no_margins
JiHO
---
http://jo.irisson.free.fr/