jpng | R Documentation |
Get file name and recreate plot on a png or pdf device. This program makes an attempt to keep the same size plot as viewed in the screen.
jpng(file='tmp', width = 8, height = 8,P = NULL, bg = "white")
jpdf(file='tmp', width = 8, height = 8,P = NULL)
file |
png or pdf: will be added as a suffix, if needed |
width |
width, inches |
height |
height, inches |
P |
vector to fix the size, c(width, height) |
bg |
background color (default="transparent") |
If P=c(10,12) is missing or NULL, program will attempt to use current plotting region via par to duplicated the size of the postscript device. Must close this device with dev.off() to finish. If either w or h are provided they will override the values in vector P.
If the standard suffix (png or pdf) are provided the file will be set. If these are omitted, they will be added to the given name according to the local.file function.
Graphical Side Effect
Jonathan M. Lees<jonathan.lees.edu>
par, postscript, device
## Not run:
jjj = local.file('hi', 'png')
x= rnorm(10)
y= rnorm(10)
plot(x,y)
print('resize the current plot')
jpng(jjj, width = 8, height = 8)
plot(x,y)
dev.off()
jpdf("HiThere.pdf", width = 8, height = 8 )
plot(x,y)
dev.off()
jpng("HiThere.png", width = 8, height = 8 , bg='red' )
plot(x,y)
dev.off()
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.