pyscatter: Plot a scatter plot using pyplot.scatter

Description Usage Arguments See Also Examples

Description

Draw a scatter plot using matplotlib.pyplot.scatter

Usage

1
2
3
pyscatter(x, y, s = 20, c = "b", marker = "o", cmap = NULL,
  norm = NULL, vmin = NULL, vmax = NULL, alpha = 1, linewidths = NULL,
  args = NULL, show = FALSE)

Arguments

x

numeric vector containing the x coordinates of points

y

numeric vector containing the y coordinates of points

s

numeric of either length 1 or length(x) indicating the size of each point

c

color of the points (default: "b"), can be one of

  • single character for basic built-in matplotlib colors, see http://matplotlib.org/api/colors_api.html#module-matplotlib.colors

  • a numeric value between 0 and 1 as character, indicating gray shade, e.g. "0.75"

  • hex string, e.g. "#00ff00" for green

  • character string with HTML color name, e.g. "slateblue", see http://www.w3schools.com/html/html_colornames.asp

  • a character vector of length(x) containing a color specification as described above for each point separately

  • a numeric vector of length(x), where each numeric is used to map the according point to a colormap using the cmap, norm, vmin and vmax arguments

  • a numeric matrix with length(x) rows and three columns. Each row represents one point in x/y, the rows set values for RGB (red, green and blue, each between 0 and 1)

  • a numeric matrix with length(x) rows and four columns. Each row represents one point in x/y, the rows set values for RGBA (red, green, blue and alpha, each between 0 and 1)

marker

single character indicating shape of the points (default: "o"), see http://matplotlib.org/api/markers_api.html#module-matplotlib.markers

cmap

character string containing either the name of a matplotlib colormap (see http://matplotlib.org/examples/color/colormaps_reference.html) or a string containing a Python call that returns an object of class Colormap, e.g. "matplotlib.cm.get_cm('Reds')" (default: NULL).

norm

character string containing a Python call that returns an object of class Normalize, e.g. "matplotlib.colors.Normalize(0, 20)" (default: NULL)

vmin

numeric. If c is a numeric vector, vmin defines what value is mapped to the lower end of the colormap (default: NULL; is set to max(c) if c is numeric)

vmax

numeric. If c is a numeric vector, vmin defines what value is mapped to the upper end of the colormap (default: NULL; is set to max(c) if c is numeric)

alpha

numeric indicating transparency (0-1, default: 1)

linewidths

numeric of either length 1 or length(x) indicating the border width of the points (default: 1)

args

character string of further arguments passed to the **kwargs argument of matplotlib.pyplot.scatter

show

bool indicating whether to open a window with the plot

See Also

pyplot http://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.scatter

Examples

1
2
3
4
pyscatter(runif(20), runif(20), s = runif(20, 50, 200),
          c = runif(20, 0, 100), cmap = "Blues", vmin = 0, vmax = 80)

if (interactive()) pyshow()

mpastell/Rpyplot documentation built on May 23, 2019, 6:27 a.m.