plot_density: Plots a density or image

Description Usage Arguments Details Author(s) See Also Examples

Description

Create a 2d image or contour plot of the density, intensity or any image object.

For examples see

http://faculty.missouri.edu/~micheasa/sppmix/sppmix_all_examples.html#plot_density

Usage

1
2
plot_density(density_df, contour = FALSE, grayscale = FALSE, pp = NULL,
  surf = NULL, ppsize = 1, main = "2d surface (density or intensity)")

Arguments

density_df

A data frame. Typically density_df=as.data.frame(imdens), where imdens an im object.

contour

Logical flag requesting the countour plot only.

grayscale

Plot in gray scale. Default is FALSE (use colors).

pp

Optional point pattern to display (a ppp or sppmix object).

surf

Optional intensity_surface object containing means to be displayed in the plot.

ppsize

Size of the points in the plot.

main

A title for the 2d plot.

Details

This function does not open a new window for the plot.

Author(s)

Sakis Micheas

See Also

dnormmix

Examples

1
2
3
4
5
6
7
8
# plot a mixture of normals density
truemix <- rnormmix(m = 3, sig0 = .1, df = 5, xlim= c(0, 5), ylim = c(0, 5))
summary(truemix)
normdens=dnormmix(truemix, xlim = c(0, 5), ylim = c(0, 5))
#2d plots
plot_density(normdens, main="2d mixture density plot\nWindow=[0,5]x[0,5]")
#Contour plot
plot_density(normdens, contour=TRUE, main="2d mixture contour plot\nWindow=[0,5]x[0,5]")

sppmix documentation built on Jan. 13, 2021, 10:04 p.m.