disp.plot5: Plotting of irregular spaced matrix data with aribitary...

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/disp.plot5.R

Description

New Super-Experimental disp.plot3 function including gridded bivariate interpolation for irregular data from the akima package.

Usage

1
2
3
disp.plot5(x,y,z,fx=nothing_x,fy=nothing_y,nx=length(unique(x)),ny=length(unique(y)),method="bilinear",...)
nothing_x(x,y)
nothing_y(x,y)

Arguments

x

x vector

y

y vector

z

z vector

fx

function of x and y returning the functional transformation of the x-axis

fy

function of x and y returning the functional transformation of the y-axis

nx,ny

The square image will be constructed from nx by ny polygons. If nx and ny are equal to the defaults, length(unique(x)) and length(unique(y)), the plot produced will be identical to disp.plot3. Higher values of nx and ny will produce smoother plots.

method

Specifies the interpolation method to use. Default is 'bilinear' using akima::interp, you can also use 'bicubic' (from akima::bicubic.grid).

...

The usual arguments to the image function as x,y,or z or as a list with x,y,z as components. One can also include a breaks argument for an unequal color scale with color scale boundaries at the breaks (see example in the image.plot documentation).

Details

A new version of the disp.plot function for plotting non-linearlly spaced data, with the addition of bivariate smoothing of the dataset. Experimental!

Because the smoothing function is always called, disp.plot4 is x5 times slower than disp.plot3 when producing the same image.

Also note, the use of fx and fy is different in this case. In this function fx and fy are passed as functions, not raw vectors. See the examples for how to use this method to plot dispersion.

nothing_x(x,y) and nothing_y(x,y) are the default functions for transformations, and do nothing (i.e. return x and y respectivley)

Value

Returns an image plot of the data

Author(s)

Tom Constant

See Also

image.plot, interp, bicubic.grid

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
data(SPPdispersion)

x<-SPPdispersion$wavelength*1e9
y<-SPPdispersion$angle
z<-SPPdispersion$reflection

kx<-function(x,y) (2*pi/(x*1e-9))*sin(y*pi/180)
omega<-function(x,y) 2*pi*3e8/(x*1e-9)

disp.plot5(x,y,z)

disp.plot5(x,y,z,fx=kx,fy=omega,nx=200,ny=200,method="bicubic")

tjconstant/photonMonkey documentation built on Feb. 19, 2018, 7:05 a.m.