Learn R Programming

cylcop (version 0.2.0)

plot_cop_surf: Surface Plot or Heat Map of the Distribution or the Density of a Copula

Description

This function plots the distribution or the density of a copula. It can produce a surface plot using either functions from the 'rgl' or from the 'plotly' package, or it can produce a heat map using functions from 'ggplot2'.

Usage

plot_cop_surf(
  copula,
  type = "pdf",
  plot_type = "rgl",
  resolution = 50,
  n_gridlines = 11
)

Value

Depending on plot_type, a 'ggplot' object is returned, or a 'plotly' visualization or 'rgl' plot is produced.

Arguments

copula

'cyl_copula' or a 'Copula' object from the package 'copula'.

type

character string describing what is plotted, either "pdf" or "cdf".

plot_type

character string describing what type of plot is produced. Available plot types are: "rgl": surface plot, "plotly": interactive surface plot, or "ggplot": heatmap

resolution

numeric value. The density or distribution will be calculated at resolution^2 points.

n_gridlines

numeric value giving the number of grid lines drawn in u and v direction.

References

Hodelapplcylcop

Hodelmethodcylcop

See Also

plot_cop_scat(), plot_track(), plot_joint_circ(), plot_joint_scat().

Examples

Run this code
if(interactive()){
 plot_cop_surf(copula::frankCopula(2),
   type="pdf",
   plot_type="ggplot",
   resolution = 5
 )
 plot_cop_surf(copula::frankCopula(2),
   type="cdf",
   plot_type="ggplot",
   resolution = 5
 )

#opens a new window
  plot_cop_surf(cyl_quadsec(0.1),
    type="pdf",
    plot_type="rgl"
  )
  plot_cop_surf(cyl_quadsec(0.1),
    type="pdf",
    plot_type="rgl",
    n_gridlines = 60
  )

  plot_cop_surf(cyl_quadsec(0.1),
    type="pdf",
    plot_type="plotly",
    n_gridlines = 10,
    resolution = 10
  )
}

Run the code above in your browser using DataLab