Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

powerplot

Plot of Power Functions


Description

This function plots powers of a variable on the interval [0,10].

Usage

powerplot(expr="x^2", xlab="x", ylab="y")

Arguments

expr

Functional form to be plotted

xlab

x-axis label

ylab

y-axis label

Details

Other expressions such as "sin(x)" and "cos(x)", etc. could also be plotted with this function, but results are not guaranteed.

Value

A plot of the given expression on the interval [0,10].

Author(s)

J.H. Maindonald

Examples

oldpar <- par(mfrow = c(2, 3), mar = par()$mar - c(
        1, 1, 1.0, 1),  mgp = c(1.5, 0.5, 0),  oma=c(0,1,0,1))
#    on.exit(par(oldpar))
    powerplot(expr="sqrt(x)", xlab="")
    powerplot(expr="x^0.25", xlab="", ylab="")
    powerplot(expr="log(x)", xlab="", ylab="")
    powerplot(expr="x^2")
    powerplot(expr="x^4", ylab="")  
    powerplot(expr="exp(x)", ylab="")
par(oldpar)

DAAG

Data Analysis and Graphics Data and Functions

v1.24
GPL-3
Authors
John H. Maindonald and W. John Braun
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.