drawPng {harupdf} R Documentation

Draw One PNG File


drawPng draws one PNG image at the given locations and sizes.


            xleft, ybottom, xright, ytop,
            angle = 0, ...)


png_file a character string giving the name of the PNG file
xleft a real value for left x positions.
ybottom a real value for bottom y positions.
xright a real value for right x positions.
ytop a real value for top y positions.
angle angle of rotation (in degrees, anti-clockwise from positive x-axis, about the bottom-left corner).
... graphical parameters.


The positions supplied, i.e., xleft, ..., are relative to the current plotting region. If the x-axis goes from 100 to 200 then xleft should be larger than 100 and xright should be less than 200. The position vectors will be recycled to the length of the longest.

See Also

rasterImageand drawJpeg and others for flexible ways to draw image on the PDF device.



#Create a PDF file
harupdf(file="C:\temp\haru_test.pdf", paper="letter", width=7, height=9.5);

plot(0:20, 0:20, type="n", xlim=c(0, 7*72), ylim=c(0, 9.5*72), xlab="", ylab="", xaxt="n", yaxt="n", bty="n");
#draw a PNG image on the plot
drawPng("C:\temp\huge.png",0,0, 7*72, 9.5*72,0);

#close device and output file

[Package harupdf version 2.12.0 Index]