cranvas (version 0.8.5)

qsave: Save the plot to a file

Description

This function saves a plot view to a image file like PNG or JPEG, etc.

Usage

qsave(filename = "Rplot.png", view, width = 480, height = 480)

Arguments

obj
the view object (usually returned by a plotting function)
filename
the file name (must have an explicit extension; see the references for supported image formats)
width
the desired width (pixels)
height
the desired height

Value

TRUE if the plot is successfully saved; otherwise FALSE

References

Supported image formats: http://doc.qt.nokia.com/latest/qimagewriter.html#supportedImageFormats

Examples

Run this code
library(cranvas)
qtennis <- qdata(tennis)
v <- qbar(matches, data = qtennis)
qsave("tennis_bar.png", v, 480, 320)

Run the code above in your browser using DataCamp Workspace