Package 'contourPlot'

Title: Plots x,y,z Co-Ordinates in a Contour Map
Description: Plots a set of x,y,z co-ordinates in a contour map. Designed to be similar to plots in base R so additional elements can be added using lines(), points() etc. This package is intended to be better suited, than existing packages, to displaying circular shaped plots such as those often seen in the semi-conductor industry.
Authors: Tony Murphy
Maintainer: Tony Murphy <[email protected]>
License: MIT +file LICENSE
Version: 0.2.0
Built: 2024-10-26 03:09:11 UTC
Source: https://github.com/cran/contourPlot

Help Index


Create a Set of Circle Co-Ordinates

Description

Creates a set of circle co-ordinates, of radius r, at position x,y

Usage

circle(x, y, r = 1)

Arguments

x

x position of the center of the circle

y

y position of the center of the circle

r

radius of the circle

Value

Matrix of x,y co-ordinates for a circle

Examples

plot(circle(0, 0, r = 1), type = 'l', asp = 1)

Plot a contour map

Description

Takes x,y,z co-ordinates and plots them on a contour map. Smoothing and interpolation is done by means of fitting a spline to the data.

Usage

contourPlot(
  x,
  y,
  z,
  nx = length(unique(x)),
  main = NULL,
  axis = TRUE,
  legend = TRUE,
  xlab = "",
  ylab = "",
  col = NULL,
  breaks = NULL,
  nlevels = 10,
  legend_pos = 4
)

Arguments

x

a vector of x co-ordinates

y

a vector of y co-ordinates

z

a vector of z co-ordinates representing the height of the contours

nx

The number of pixels that will be in final plot. default is length(unique(x))

main

Title of plot

axis

logical if TRUE displays the axes of the plot

legend

logical if TRUE displays the legend

xlab

label on x axis

ylab

label on y axis

col

list of colors to be applied to contours.

breaks

list of values indicating the contour ranges

nlevels

useful if breaks and col are left as null. Sets the number of levels of the contours to be plotted

legend_pos

set position of the colour bar. Default = 4.

Value

A contour plot (similar to those in base, additional elements can be added using lines, points functions etc.

Examples

x <- Volcontour$x
y <- Volcontour$y
z <- Volcontour$z

contourPlot(x = x, y = y, z = z)

# A smoother contour
contourPlot(x = x, y = y, z = z, nx = 500)

# Changing breaks and colours
breaks = pretty(c(min(z),max(z)))
col = brewer.pal(n = length(breaks)-1, "Blues")
contourPlot(x = x, y = y, z = z, nx = 500, breaks = breaks, col = col)

# add lines
lines(circle(0, 0, 26.5))

Re-formatted version of the base dataset volcano.

Description

A dataset containg the x,y,z co-ordinates of the base data set volcano. Data is cropped in a radius <25 from the center of the volcano crater

Usage

Volcontour

Format

An object of class tbl_df (inherits from tbl, data.frame) with 1941 rows and 3 columns.

Details

@format a data frame with 1941 obs. and 3 variables

@source r base package